feat(mbe): throw valid error when server is down#105
Merged
Conversation
pranavjain97
requested changes
Aug 6, 2025
pranavjain97
left a comment
Contributor
There was a problem hiding this comment.
Can you try calling this.checkServerRunning(error); at the responseHandler instead? That way u dont need to add it for every catch statement.
| } catch (error: any) { | ||
| this.errorHandler(error, 'Error posting key to KMS'); | ||
|
|
||
| throw new Error(`Failed to post key to KMS: ${error.message}`); |
Contributor
There was a problem hiding this comment.
isnt the error already being thrown by this.errorHandler
Contributor
Author
There was a problem hiding this comment.
fixed. sorry, there was a conflict when I rebase.
| } catch (error: any) { | ||
| this.errorHandler(error, 'Error decrypting data key from KMS'); | ||
|
|
||
| throw new Error(`Failed to decrypt data key from KMS: ${error.message}`); |
Contributor
There was a problem hiding this comment.
remove all of these new errors, already handled by errorHandler
56bf470 to
3041201
Compare
pranavjain97
reviewed
Aug 7, 2025
| logger.error( | ||
| 'Failed to create independent keychain: %s', | ||
| (error as DecodeError).decodedResponse.body, | ||
| (error as DecodeError).decodedResponse?.body, |
Contributor
There was a problem hiding this comment.
why does it need be optional now?
Contributor
Author
There was a problem hiding this comment.
I tested it and found that decodedResponse is undefined when the kms or aws is offline and it throws another error because of getting body from decodedResponse
pranavjain97
previously approved these changes
Aug 7, 2025
b71cc7c to
3207ec9
Compare
pranavjain97
approved these changes
Aug 8, 2025
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.
TASKS: WP-5513