https://kotlinlang.org logo
#codereview
Title
# codereview
h

Hamza

06/21/2018, 2:47 PM
Copy code
"INVALID REQUEST"                     -> html("The PayPal API failed us. INVALID_REQUEST")
      "AUTHENTICATION_FAILURE"              -> html("I'm sure we authenticated. Right, guys? AUTHENTICATION_FAILURE")
      "NOT_AUTHORIZED"                      -> html("What do you mean we are not authorized? >:( NOT_AUTHORIZED")
      "RESOURCE_NOT_FOUND"                  -> html("Guys, we need to update our API. RESOURCE_NOT_FOUND")
      "METHOD_NOT_SUPPORTED"                -> html("This wasn't suppose to happen... METHOD_NOT_SUPPORTED")
      "MEDIA_TYPE_NOT_ACCEPTABLE"           -> html("This wasn't suppose to happen... MEDIA_TYPE_NOT_ACCEPTABLE")
      "UNPROCESSABLE_ENTITY"                -> html("Guys, we broke PayPal! UNPROCESSABLE_ENTITY")
      "RATE_LIMIT_REACHED"                  -> html("We've reached max capacity. Please try again later. RATE_LIMIT_REACHED")
      "INTERNAL_SERVICE_ERROR"              -> html("Look. PayPal. You need to fix your system. INTERNAL_SERVICE_ERROR")
      "SERVICE_UNAVAILABLE"                 -> html("PayPal is not available at the moment. Please try again later. SERVICE_UNAVAILABLE")
is there a better way?
m

Max Russek

06/21/2018, 2:49 PM
Could you have this data in a configuration file? If you moved it to a json data format then people could write tools that operate on that data set automatically
h

Hamza

06/21/2018, 2:49 PM
hmm, not a bad idea
3 Views