Enum ApodErrorCode
The error code of an ApodError.
Namespace: Apod
Assembly: Apod.dll
Syntax
public enum ApodErrorCode : int
Remarks
Not to be confused with ApodStatusCode.
Examples
var error = response.Error;
switch (error.ErrorCode)
{
case ApodErrorCode.DateOutOfRange:
Console.WriteLine(error.ErrorMessage);
break;
case ApodErrorCode.Timeout:
Console.WriteLine("Try with dates that are closer together.");
break;
case ApodErrorCode.OverRateLimit:
Console.WriteLine("You have made too many requests. Come back in a bit.");
break;
default:
Console.WriteLine("An error occured. Try again.");
break;
}
Fields
Name | Description |
---|---|
ApiKeyInvalid | Your API key was invalid. |
ApiKeyMissing | You did not provide an API key. |
BadRequest | The API returned a BadRequest error that this library did not catch. If you get an error with this code, please file a bug report at https://github.com/LeMorrow/APOD.Net/issues/new?assignees=LeMorrow&labels=bug&template=bug_report.md&title= |
CountOutOfRange | The count that you provided was outside of the allowed range. |
DateOutOfRange | One of the dates you provided were outside of the allowed range. |
InternalServiceError | The server had an internal error. This could for example mean that it timed out without giving a proper timeout error or that NASA's API servers are down currently. |
None | The previous request was successful. |
OverRateLimit | You have done too many requests in the past hour. |
StartDateAfterEndDate | The start date was after the end date. |
Timeout | The server timed out. Try making smaller requests or try again later. |
Unknown | You have encountered a completely unkown bug. Congratulations! Please take a few seconds and tell us what you did here: https://github.com/LeMorrow/APOD.Net/issues/new?assignees=LeMorrow&labels=bug&template=unknown-error.md&title=Unknown+error |