Improve error handling: propagate and surface swallowed errors - #12
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Improve error handling: propagate and surface swallowed errors#12devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Visit the preview URL for this PR (updated for commit 824aae3): https://decentralized-dall-e--pr12-devin-1784700382-err-7t13tiwu.web.app (expires Wed, 29 Jul 2026 06:09:26 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 9f3ca659ce42113c1a9d85a3ba19a54f05478557 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Several errors were being silently swallowed or left unhandled across the backend and frontend, causing failures to either crash the server (unhandled promise rejections) or fail silently in the UI with no feedback. This PR propagates those errors and surfaces them to the user/logs.
Backend (
backend/index.js)submitandsubmissionsroute handlers only wrapped part of their logic (or nothing) in try/catch, sogetSigner/axios/estimateGasfailures became unhandled rejections with no HTTP response. Now the full handler bodies are wrapped and return500 { success: false, error }. The error field now sendse.messageinstead of the raw error object (which didn't serialize and leaked internals).urls_from_promptswallowed all errors and loggede.response.data(itself throwing whene.responseis undefined), then returnedundefinedwhile the ws handler still repliedsuccess: true. Removed the internal swallow so the error propagates to the caller.success: true. It now catches parse/generation failures and replies{ success: false, error }:downloadImage(...)/urls_from_prompt(...)calls now have.catchso a boot-time failure logs instead of an unhandled rejection.Frontend
helpers/web3.ts: the.send(...)callbacks didif (err) reject(err); resolve(data)—resolveran even after a reject. Changed toelse resolve(data)incallMakeTask,callSubmit,callAssignWinner.SubmitSection.tsx: two empty.catch((e) => {})blocks swallowed proposal failures; now log +alert.JSON.parseof the ws message is wrapped in try/catch, and asuccess: falseresult now alerts and clears the loading state.WinnerSection.tsx:.catch()with no handler re-threw (unhandled rejection); now logs + alerts.Requesting.tsx:callMakeTask(...)andgetBalance(...)had no.catch; added handlers.SubmissionProvider.tsxandApp.tsxbounty-refresh chains /connectWalletcalls had no.catch; added logging. The empty// handle "add" errorMetaMask catch now logs.No behavior change on the success path; typecheck (
tsc --noEmit) passes and no new eslint errors.Link to Devin session: https://app.devin.ai/sessions/00d53b270c8c4bf4869aa206dbf9237b
Requested by: @walnutwaldo
Devin Review