This repository was archived by the owner on Feb 21, 2025. It is now read-only.
Load caps return status code sometimes different than 500#552
Open
Load caps return status code sometimes different than 500#552
Conversation
small doc for ScratchError::new_internal
Member
also some minor styling changes and slightly change error message
Member
|
Now it works, frontend already relies on this PR in release, we need to merge this |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

This pull request includes several changes to improve error handling and streamline code in the
src/caps.rsfile. The most important changes involve refactoring error handling to use a customScratchErrortype and updating function signatures accordingly.Improvements to error handling:
src/caps.rs: Changed the return type ofload_caps_buf_from_urlandload_capsfunctions to useScratchErrorinstead ofStringfor error handling. [1] [2]Codebase simplification:
src/custom_error.rs: Added a new helper functionScratchError::new_internalto createScratchErrorinstances with a defaultINTERNAL_SERVER_ERRORstatus code.src/global_context.rs: Updated error handling intry_load_caps_quickly_if_not_presentto use thestatus_codefrom the original error when creating a newScratchError.Dependency updates:
src/caps.rs: Reorganized imports to improve readability and maintain consistency.