Skip to content

Commit

Permalink
Spike3: Retrieve and display code errors without using mongodb
Browse files Browse the repository at this point in the history
- Code review comments - better error handling
  • Loading branch information
dsellarsnr committed May 13, 2024
1 parent 0089f82 commit 3963001
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions shared/ui/store/codeErrors/thunks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ export const createCodeError =
const state = getState();
const existingCodeError = getCodeError(state.codeErrors, request.errorGuid);
if (!existingCodeError) {
throw new Error("ohno");
logError(`Could not find codeError ${request.errorGuid} in state`);
} else {
existingCodeError.postId = response.post.id;
existingCodeError.streamId = response.post.streamId;
dispatch(updateCodeErrors([existingCodeError]));
}
existingCodeError.postId = response.post.id;
existingCodeError.streamId = response.post.streamId;
dispatch(updateCodeErrors([existingCodeError]));
}
return response;
} catch (error) {
Expand Down

0 comments on commit 3963001

Please sign in to comment.