Error cleanup

#11 #13 #14
This commit is contained in:
2020-12-05 19:01:30 +01:00
parent 21ad622c10
commit 33b3bcb8c2
11 changed files with 50 additions and 43 deletions

View File

@@ -2,7 +2,7 @@ import { IsString } from 'class-validator';
import { ForbiddenError, NotAcceptableError, NotFoundError, UnauthorizedError } from 'routing-controllers';
/**
* Error to throw when a jwt is expired
* Error to throw when a jwt is expired.
*/
export class ExpiredJWTError extends UnauthorizedError {
@IsString()
@@ -13,7 +13,7 @@ export class ExpiredJWTError extends UnauthorizedError {
}
/**
* Error to throw when a jwt could not be parsed
* Error to throw when a jwt could not be parsed.
*/
export class IllegalJWTError extends UnauthorizedError {
@IsString()
@@ -24,7 +24,7 @@ export class IllegalJWTError extends UnauthorizedError {
}
/**
* Error to throw when user is nonexistant or refreshtoken is invalid
* Error to throw when user is nonexistant or refreshtoken is invalid.
*/
export class UserNonexistantOrRefreshtokenInvalidError extends UnauthorizedError {
@IsString()
@@ -35,7 +35,7 @@ export class UserNonexistantOrRefreshtokenInvalidError extends UnauthorizedError
}
/**
* Error to throw when provided credentials are invalid
* Error to throw when provided credentials are invalid.
*/
export class InvalidCredentialsError extends UnauthorizedError {
@IsString()
@@ -46,7 +46,7 @@ export class InvalidCredentialsError extends UnauthorizedError {
}
/**
* Error to throw when a jwt does not have permission for this route/ action
* Error to throw when a jwt does not have permission for this route/action.
*/
export class NoPermissionError extends ForbiddenError {
@IsString()
@@ -57,7 +57,7 @@ export class NoPermissionError extends ForbiddenError {
}
/**
* Error to thow when no username and no email is set
* Error to throw when no username and no email is set.
*/
export class UsernameOrEmailNeededError extends NotAcceptableError {
@IsString()
@@ -68,7 +68,7 @@ export class UsernameOrEmailNeededError extends NotAcceptableError {
}
/**
* Error to thow when no password is provided
* Error to throw when no password is provided.
*/
export class PasswordNeededError extends NotAcceptableError {
@IsString()
@@ -79,7 +79,7 @@ export class PasswordNeededError extends NotAcceptableError {
}
/**
* Error to thow when no user could be found for provided credential
* Error to throw when no user could be found mating the provided credential.
*/
export class UserNotFoundError extends NotFoundError {
@IsString()
@@ -90,7 +90,7 @@ export class UserNotFoundError extends NotFoundError {
}
/**
* Error to thow when no jwt token was provided
* Error to throw when no jwt token was provided (but one had to be).
*/
export class JwtNotProvidedError extends NotAcceptableError {
@IsString()
@@ -101,7 +101,7 @@ export class JwtNotProvidedError extends NotAcceptableError {
}
/**
* Error to thow when user was not found or refresh token count was invalid
* Error to throw when user was not found or refresh token count was invalid.
*/
export class UserNotFoundOrRefreshTokenCountInvalidError extends NotAcceptableError {
@IsString()
@@ -112,7 +112,7 @@ export class UserNotFoundOrRefreshTokenCountInvalidError extends NotAcceptableEr
}
/**
* Error to thow when refresh token count was invalid
* Error to throw when refresh token count was invalid
*/
export class RefreshTokenCountInvalidError extends NotAcceptableError {
@IsString()