Skip to content

Commit

Permalink
ref: initialise error messages in args
Browse files Browse the repository at this point in the history
  • Loading branch information
mantariksh committed Nov 16, 2020
1 parent d36b844 commit 891a54d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/app/services/myinfo/myinfo.errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,43 @@ import { ApplicationError } from '../../modules/core/core.errors'
* Circuit breaker is open
*/
export class CircuitBreakerError extends ApplicationError {
constructor(message?: string) {
super(message ?? 'Circuit breaker tripped')
constructor(message = 'Circuit breaker tripped') {
super(message)
}
}

/**
* Error while attempting to retrieve MyInfo data from the MyInfo API
*/
export class FetchMyInfoError extends ApplicationError {
constructor(message?: string) {
super(message ?? 'Error while requesting MyInfo data')
constructor(message = 'Error while requesting MyInfo data') {
super(message)
}
}

/**
* Error while attempting to hash data or compare hashed data
*/
export class HashingError extends ApplicationError {
constructor(message?: string) {
super(message ?? 'Error occurred while hashing data')
constructor(message = 'Error occurred while hashing data') {
super(message)
}
}

/**
* Hashes not found in the database
*/
export class MissingHashError extends ApplicationError {
constructor(message?: string) {
super(message ?? 'Requested hashes not found in database')
constructor(message = 'Requested hashes not found in database') {
super(message)
}
}

/**
* Hashes did not match responses
*/
export class HashDidNotMatchError extends ApplicationError {
constructor(message?: string) {
super(message ?? 'Responses did not match hashed values')
constructor(message = 'Responses did not match hashed values') {
super(message)
}
}

0 comments on commit 891a54d

Please sign in to comment.