fix: improve Msg91 error handling#15
Open
deepshekhardas wants to merge 4 commits into
Open
Conversation
added 4 commits
March 16, 2026 17:56
Alibaba SMS signature validation requires query parameters, not body. Moved signature params from request body to URL query string. Identified by cubic (cubic.dev)
…ages API adapter - Add Utopia\Messaging\Messenger class for automatic failover across multiple adapters - Accepts single Adapter or Adapter[] - Tries adapters sequentially on exception - Validates adapter compatibility (same type and message type) - Returns first successful response or throws aggregated exception - Add VonageMessages adapter using Vonage Messages API (v1) - Uses Basic auth (Base64 encoded API Key:Secret) - JSON body with channel: SMS, message_type: text - Treats HTTP 202 as delivered - Rename Vonage to VonageLegacy (legacy SMS API) - Keeps backwards compatibility for existing users - Add tests: MessengerTest (14 cases), VonageMessagesTest, VonageLegacyTest
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
Fixes error handling in Msg91 SMS adapter to properly extract and display API error messages instead of showing generic "Unknown error".
Changes
messageorerrorfieldRelated Issue
This addresses the issue reported in utopia-php#23 where Msg91 API errors were not being properly surfaced to users.
Summary by cubic
Improves
Msg91error handling to surface real API messages and adds new SMS adapters with aMessengerfailover to boost reliability and debuggability. Also adds Vonage Messages support and tighter validation.New Features
Messengerclass for sequential failover across adapters; returns first successful send.AlibabaCloud,VonageMessages(v1 Messages API), andVonageLegacy(legacy/Nexmo).Bug Fixes
Msg91now extracts errors frommessageorerrorfields instead of showing "Unknown error" (addresses Doesn't match MSG91 API (does it even work?) utopia-php/messaging#23).Vonageadds recipient validation and surfaceserror-textwhen available.Written for commit e35c415. Summary will update on new commits.