mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Add status code for service account error (#1707)
This commit is contained in:
parent
6bbff58faa
commit
07a3dbb372
|
@ -53,6 +53,10 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||||
return await this.helpers.requestOAuth2.call(this, 'googleBooksOAuth2Api', options);
|
return await this.helpers.requestOAuth2.call(this, 'googleBooksOAuth2Api', options);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
|
||||||
|
error.statusCode = '401';
|
||||||
|
}
|
||||||
|
|
||||||
throw new NodeApiError(this.getNode(), error);
|
throw new NodeApiError(this.getNode(), error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,10 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||||
return await this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options);
|
return await this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
|
||||||
|
error.statusCode = '401';
|
||||||
|
}
|
||||||
|
|
||||||
throw new NodeApiError(this.getNode(), error);
|
throw new NodeApiError(this.getNode(), error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,10 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
|
||||||
|
error.statusCode = '401';
|
||||||
|
}
|
||||||
|
|
||||||
throw new NodeApiError(this.getNode(), error);
|
throw new NodeApiError(this.getNode(), error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,10 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||||
return await this.helpers.requestOAuth2.call(this, 'googleSheetsOAuth2Api', options);
|
return await this.helpers.requestOAuth2.call(this, 'googleSheetsOAuth2Api', options);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
|
||||||
|
error.statusCode = '401';
|
||||||
|
}
|
||||||
|
|
||||||
throw new NodeApiError(this.getNode(), error);
|
throw new NodeApiError(this.getNode(), error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,4 +142,4 @@ export function hexToRgb(hex: string) {
|
||||||
green: parseInt(result[2], 16),
|
green: parseInt(result[2], 16),
|
||||||
blue: parseInt(result[3], 16),
|
blue: parseInt(result[3], 16),
|
||||||
} : null;
|
} : null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,10 @@ export async function googleApiRequest(
|
||||||
return await this.helpers.requestOAuth2!.call(this, 'googleSlidesOAuth2Api', options);
|
return await this.helpers.requestOAuth2!.call(this, 'googleSlidesOAuth2Api', options);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') {
|
||||||
|
error.statusCode = '401';
|
||||||
|
}
|
||||||
|
|
||||||
throw new NodeApiError(this.getNode(), error);
|
throw new NodeApiError(this.getNode(), error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue