Skip to content

Commit

Permalink
NAS-131245: UI obscures error messages (#11081)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKarpov98 authored Nov 23, 2024
1 parent 1c845c9 commit 9748769
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/interfaces/api-error.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface ApiError {
reason: string;
trace: ApiErrorTrace;
type: ResponseErrorType | null;
message?: string | null;
}

export interface ApiErrorTrace {
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/websocket/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class ApiService {

private printError(error: ApiError, context: { method: string; params: unknown }): void {
if (error.errname === ApiErrorName.NoAccess) {
console.error(`Access denied to ${context.method} with ${context.params ? JSON.stringify(context.params) : 'no params'}`);
console.error(`Access denied to ${context.method} with ${context.params ? JSON.stringify(context.params) : 'no params'}. Original message: ${error.message}`);
return;
}

Expand All @@ -180,7 +180,7 @@ export class ApiService {
if (error.errname === ApiErrorName.NoAccess) {
return {
...error,
reason: this.translate.instant('Access denied to {method}', { method: context.method }),
reason: error.message || this.translate.instant('Access denied to {method}', { method: context.method }),
};
}
return error;
Expand Down

0 comments on commit 9748769

Please sign in to comment.