(event: RTMCallResult & { error: { msg: string; } })
| 74 | * A factory to create RTMPlatformError objects. |
| 75 | */ |
| 76 | export function platformErrorFromEvent(event: RTMCallResult & { error: { msg: string; } }): RTMPlatformError { |
| 77 | const error = errorWithCode( |
| 78 | new Error(`An API error occurred: ${event.error.msg}`), |
| 79 | ErrorCode.SendMessagePlatformError, |
| 80 | ) as Partial<RTMPlatformError>; |
| 81 | error.data = event; |
| 82 | return (error as RTMPlatformError); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * A factory to create RTMNoReplyReceivedError objects. |
no test coverage detected