Skip to content

Improve error messages from server actions in 6-server.js #292

@avinxshKD

Description

@avinxshKD

The error handling in src/graph-builder/graph-core/6-server.js is pretty bare-bones right now. All the server actions (build, debug, run, clear, stop, destroy, library) just do:

.catch((err) => {
    toast.error(err.message);
    toast.dismiss(toastId);
});

So when the backend returns something useful like "Invalid workflow file" or "Permission denied", users just see "Request failed with status code 500" or "Network Error".

Compare this to ContributeDetails.jsx which actually checks the response:

catch (error) {
    if (error?.response?.status === 400) {
        toast.info(error?.response?.data?.message);
    } else {
        toast.error(error?.response.data.message);
    }
}

We should update all those catch blocks to look for err.response?.data?.message first before falling back to err.message. Makes debugging way easier for userss

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions