Skip to content

Commit

Permalink
#1 Fixing migration error alert
Browse files Browse the repository at this point in the history
  • Loading branch information
rpeach-sag committed Jan 7, 2020
1 parent 4536093 commit a071284
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/migrate/migrate.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,13 @@ export class MigrateComponent {
}
this.dirty = false;
} catch(e) {
alrt.update('Error: ' + e.toString(), 'danger');
if (e instanceof Error) {
alrt.update(`${e.name || 'Error'}: ${e.message}`, 'danger');
} else if (e.data && e.data.error) {
alrt.update(`${e.data.error}: ${e.data.message}`, 'danger');
} else {
alrt.update('Error: Check browser console for details', 'danger');
}
throw(e);
} finally {
this.reset();
Expand Down

0 comments on commit a071284

Please sign in to comment.