MCPcopy
hub / github.com/slackapi/node-slack-sdk / platformErrorFromResult

Function platformErrorFromResult

packages/web-api/src/errors.ts:92–99  ·  view source on GitHub ↗
(result: WebAPICallResult & { error: string; })

Source from the content-addressed store, hash-verified

90 * @param result - Web API call result
91 */
92export function platformErrorFromResult(result: WebAPICallResult & { error: string; }): WebAPIPlatformError {
93 const error = errorWithCode(
94 new Error(`An API error occurred: ${result.error}`),
95 ErrorCode.PlatformError,
96 ) as Partial<WebAPIPlatformError>;
97 error.data = result;
98 return (error as WebAPIPlatformError);
99}
100
101/**
102 * A factory to create WebAPIRateLimitedError objects

Callers 1

apiCallMethod · 0.90

Calls 1

errorWithCodeFunction · 0.70

Tested by

no test coverage detected