Skip to content

fix: improve Msg91 error handling#15

Open
deepshekhardas wants to merge 4 commits into
mainfrom
fix/msg91-error-handling
Open

fix: improve Msg91 error handling#15
deepshekhardas wants to merge 4 commits into
mainfrom
fix/msg91-error-handling

Conversation

@deepshekhardas
Copy link
Copy Markdown
Owner

@deepshekhardas deepshekhardas commented May 14, 2026

Summary

Fixes error handling in Msg91 SMS adapter to properly extract and display API error messages instead of showing generic "Unknown error".

Changes

  • Extract error message from API response message or error field
  • Provides more descriptive error messages for debugging

Related 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 Msg91 error handling to surface real API messages and adds new SMS adapters with a Messenger failover to boost reliability and debuggability. Also adds Vonage Messages support and tighter validation.

  • New Features

    • Messenger class for sequential failover across adapters; returns first successful send.
    • New SMS adapters: AlibabaCloud, VonageMessages (v1 Messages API), and VonageLegacy (legacy/Nexmo).
  • Bug Fixes

Written for commit e35c415. Summary will update on new commits.

deepshekhardas 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant