errorResponse function
Implementation
AppException errorResponse(ErrorType type) {
switch (type) {
case ErrorType.badRequest:
return const BadRequest();
case ErrorType.unauthorized:
return const Unauthorized();
case ErrorType.paymentRequired:
return const PaymentRequired();
case ErrorType.forbidden:
return const Forbidden();
case ErrorType.notFound:
return const NotFound();
case ErrorType.methodNotAllowed:
return const MethodNotAllowed();
case ErrorType.notAcceptable:
return const NotAcceptable();
case ErrorType.internalServerError:
return const InternalServerError();
case ErrorType.notImplemented:
return const NotImplemented();
case ErrorType.badGateway:
return const BadGateway();
default:
return const UnknownException();
}
}