Skip to content

Fix: Improve MediasoupError description readability #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sharukmsd
Copy link

Problem

When catching MediasoupError, the error description was not properly accessible through localizedDescription, resulting in generic error messages like "MediasoupError error 4" instead of the actual detailed error description.

Solution

Added LocalizedError protocol conformance to MediasoupError to properly expose the underlying error descriptions. This makes error messages more descriptive and helpful for debugging.

Changes

  • Made MediasoupError conform to LocalizedError
  • Implemented errorDescription property to provide detailed error messages
  • Error messages now include the full context of the underlying error

Example

Before:

catch error {
print(error.localizedDescription)
// Prints: "MediasoupError error 4"
}

After:

catch error {
print(error.localizedDescription)
// Prints: "Unknown error: [json.exception.parse_error.101] parse error at line 1..."
}

This change helps developers better understand and debug issues.

- Add LocalizedError protocol conformance to MediasoupError
- Implement errorDescription property for detailed error messages
- Expose underlying error details in localizedDescription
- Fix error message readability in debugging scenarios
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