Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug: increase logs of simulateBundle endpoint #105

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yvesfracari
Copy link
Contributor

No description provided.

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add some error handling in the repository. Handle and retrow logic.

At minimum we can log the payload and relevant response HTTP parameters
https://github.com/cowprotocol/bff/blob/main/libs/repositories/src/SimulationRepository/SimulationRepositoryTenderly.ts#L36

Alternativelly, and probably better, is to model some Error (ApiCallError) that incorporates all the relevant data we want to handle, and then the controllers handles and logs this error properly. This approach is nicer cause you don't marry to the specific logging methon, and then other similar repositories can do the same

);

if (simulationResult === null) {
reply.code(400).send({ message: 'Build simulation error' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was here before, but what does null mean, and why is a 400 is an issue from the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means that the Tenderly couldn't simulate the transaction. This happens often on the "build your own hook" where the user manually encodes the tx data.

We used a general 400 error but maybe we could change it to 422.

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants