Skip to content

basalt / drives-google/src / errorReason

Function: errorReason() ​

> errorReason(body, status): string

Defined in: drives-google/src/errors.ts:107

Pulls the first error.errors[].reason out of a Google error body.

Only a value that looks like Google's own vocabulary is kept. Anything else — an HTML page from a proxy, a stack trace, a message an attacker influenced — becomes http_<status>, because this string ends up in details, which @basaltkit/http serialises into a response body and @basaltkit/audit stores. Google's message field is free text and is never carried.

Parameters ​

body ​

string

status ​

number

Returns ​

string

Released under the MIT License.