carsonRadtke / nasabot

discord bot that talks to api.nasa.gov
Other
0 stars 0 forks source link

Forward HTTP errors back to user #5

Closed carsonRadtke closed 1 year ago

carsonRadtke commented 1 year ago

./nasa apod date=2050-01-01 replies with 'undefined by undefined' because the the api endpoint responded with

{
  "code":400,
  "msg":"Date must be between Jun 16, 1995 and Aug 06, 2023.",
  "service_version":"v1"
}

Instead of trying to coerce the response into an APODResponseSchema, there should be a mechanism of handling the error response when code is not 200 and giving the user a message that makes sense.

carsonRadtke commented 1 year ago

Closed by #7