refactor: Improve error logging/reporting for cli (#4691)
* use response error classes instead of `ResponseError` everywhere * improve error logging in dev mode or when telemetry is disabled
This commit is contained in:
committed by
GitHub
parent
5364e7fc92
commit
0b754a4f85
@@ -90,7 +90,7 @@ export function getInstanceBaseUrl(): string {
|
||||
// TODO: Enforce at model level
|
||||
export function validatePassword(password?: string): string {
|
||||
if (!password) {
|
||||
throw new ResponseHelper.ResponseError('Password is mandatory', undefined, 400);
|
||||
throw new ResponseHelper.BadRequestError('Password is mandatory');
|
||||
}
|
||||
|
||||
const hasInvalidLength =
|
||||
@@ -117,7 +117,7 @@ export function validatePassword(password?: string): string {
|
||||
message.push('Password must contain at least 1 uppercase letter.');
|
||||
}
|
||||
|
||||
throw new ResponseHelper.ResponseError(message.join(' '), undefined, 400);
|
||||
throw new ResponseHelper.BadRequestError(message.join(' '));
|
||||
}
|
||||
|
||||
return password;
|
||||
|
||||
Reference in New Issue
Block a user