Add error codes and error messages to failed results (#89)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
# Description - Added an Error Code (enum) and Error Message (string) to all the failed results #53 ## Type of change Please delete options that are not relevant. - [x] New feature (non-breaking change which adds functionality) # How Has This Been Tested? - This has been tested both manually as well as the unit tests # Checklist - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that provde my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/random-bunny/pulls/89 Co-authored-by: Ethan Lane <ethan@vylpes.com> Co-committed-by: Ethan Lane <ethan@vylpes.com>
This commit is contained in:
parent
07c37e2c06
commit
037608e059
7 changed files with 60 additions and 5 deletions
6
src/constants/ErrorCode.ts
Normal file
6
src/constants/ErrorCode.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
export enum ErrorCode {
|
||||
Unknown,
|
||||
FailedToFetchReddit,
|
||||
UnableToParseJSON,
|
||||
NoImageResultsFound,
|
||||
}
|
5
src/constants/ErrorMessages.ts
Normal file
5
src/constants/ErrorMessages.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
export default class ErrorMessages {
|
||||
public static readonly FailedToFetchReddit = "Failed to fetch result from Reddit";
|
||||
public static readonly UnableToParseJSON = "Unable to parse the JSON result";
|
||||
public static readonly NoImageResultsFound = "No image results found in response from Reddit";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue