MCPcopy Index your code
hub / github.com/slackapi/node-slack-sdk / platformErrorFromEvent

Function platformErrorFromEvent

packages/rtm-api/src/errors.ts:76–83  ·  view source on GitHub ↗
(event: RTMCallResult & { error: { msg: string; } })

Source from the content-addressed store, hash-verified

74 * A factory to create RTMPlatformError objects.
75 */
76export 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.

Callers 1

eventHandlerMethod · 0.90

Calls 1

errorWithCodeFunction · 0.70

Tested by

no test coverage detected