Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Conversation

@MDario123
Copy link

This pull request includes several changes to improve error handling and streamline code in the src/caps.rs file. The most important changes involve refactoring error handling to use a custom ScratchError type and updating function signatures accordingly.

Improvements to error handling:

  • src/caps.rs: Changed the return type of load_caps_buf_from_url and load_caps functions to use ScratchError instead of String for error handling. [1] [2]

Codebase simplification:

  • src/custom_error.rs: Added a new helper function ScratchError::new_internal to create ScratchError instances with a default INTERNAL_SERVER_ERROR status code.
  • src/global_context.rs: Updated error handling in try_load_caps_quickly_if_not_present to use the status_code from the original error when creating a new ScratchError.

Dependency updates:

  • src/caps.rs: Reorganized imports to improve readability and maintain consistency.

@alashchev17
Copy link
Member

image
Error returned is still being inferred

also some minor styling changes and slightly change error message
@MDario123 MDario123 marked this pull request as draft January 15, 2025 23:19
@MDario123 MDario123 marked this pull request as ready for review January 16, 2025 15:32
@alashchev17
Copy link
Member

Now it works, frontend already relies on this PR in release, we need to merge this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants