Skip to content

Commit

Permalink
Fix error handling new resource
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Jan 29, 2024
1 parent e0cf2d1 commit 1db4f7e
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ export function NewResourceUIProvider({ children }: PropsWithChildren) {

// If a basicInstanceHandler is registered for the class, create a resource of the given class with some default values.
if (basicNewInstanceHandlers.has(isA)) {
basicNewInstanceHandlers.get(isA)?.(parent, createAndNavigate, {
store,
settings,
});
try {
await basicNewInstanceHandlers.get(isA)?.(parent, createAndNavigate, {
store,
settings,
});
} catch (e) {
store.notifyError(e);
}

return;
}
Expand Down

0 comments on commit 1db4f7e

Please sign in to comment.