Conversation
Routes 401 to console.warn, 403 to console.log, and everything else to console.error with the full errorMap.toJSON() payload. Adds unit tests covering all branches and the map-cleared-after-logging invariant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
Commits
|
chrischrischris
approved these changes
May 20, 2026
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.
Summary
401messages →console.warn(auth info, not an error)403messages →console.log(permission info, not an error)console.errorwitherrorMap.toJSON()payload for full contexterrorMap.get('message'), falling back toJSON.stringify(errorMap.toJSON())when nomessagekey is setThis aligns with adobe/da-collab#157 - no need for an ugly error message in case of an expired token (403). 401 is more unexpected (some removed author full access to the file ?) but still warning is enough.
If message received is 403: sign up popup appears. If author signs in, latest changes are even restored and persisted
If message received is 401: redirected to the 404 page.
Test plan
Routes 401 messages to console.warn— verifies warn path and message prefixRoutes 403 messages to console.log— verifies log path and message prefixRoutes other messages to console.error with toJSON payload— verifies error path + payloadClears the error map after logging— verifieserrorMap.clear()is always calledFalls back to JSON when no message key is set— verifies fallback serialisation🤖 Generated with Claude Code