(result: WebAPICallResult & { error: string; })
| 90 | * @param result - Web API call result |
| 91 | */ |
| 92 | export 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 |
no test coverage detected