Okra-error package
This is an Okra error TypeScript Package with methods for handling errors.
Usage
import { HandleError, ValidationError, OkraBaseError } from 'okra-error'
//
At the point of Error, always ensure you throw the instance of the such as
throw new OkraBaseError()
throw new ValidationError('Invalid credentials')
Then at the central point to ensrue consistency of the error call the error class and handleError.
const errorHandler = new ErrorHandler(logger);
const processedError = errorHandler.handleError(error, 'validation')
This will ensure you have a well processed error response accross the app.