Skip to content

Commit

Permalink
Fix the error handling on the ngclient
Browse files Browse the repository at this point in the history
  • Loading branch information
sp90 committed Nov 5, 2024
1 parent 8ca3f07 commit 097433d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/app/backup/destination/destination.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ export default class DestinationComponent {
}, 3000);
},
error: (err) => {
console.error('err', err);

if (err.message === 'missing-folder') {
if (err.error.error.Error === 'missing-folder') {
this.#dialog.open(ConfirmDialogComponent, {
data: {
title: 'Create folder',
Expand Down
2 changes: 0 additions & 2 deletions src/app/backup/schedule/schedule.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,3 @@ <h3 class="title-30">Schedule</h3>
</button>
</div>
</form>

<!-- <pre>{{ scheduleForm.value | json }}</pre> -->
8 changes: 7 additions & 1 deletion src/app/core/interceptors/http.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ export const httpInterceptor: HttpInterceptorFn = (req, next) => {
}

const errorMsg = `Error Code: ${error.status}, Message: ${error.message}`;
return throwError(() => errorMsg);

return throwError(() => {
return {
error,
message: errorMsg,
};
});
})
);
};

0 comments on commit 097433d

Please sign in to comment.