Missing token/apikey error improved for display in Next.js logs
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
"@trigger.dev/typeform": patch
|
||||||
|
"@trigger.dev/github": patch
|
||||||
|
"@trigger.dev/openai": patch
|
||||||
|
"@trigger.dev/resend": patch
|
||||||
|
"@trigger.dev/plain": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Missing token/apikey error improved for display in Next.js logs
|
||||||
@@ -93,7 +93,7 @@ function createClientFromOptions(
|
|||||||
options: GithubIntegrationOptions
|
options: GithubIntegrationOptions
|
||||||
): IntegrationClient<Octokit, typeof tasks> {
|
): IntegrationClient<Octokit, typeof tasks> {
|
||||||
if (Object.keys(options).includes("token") && !options.token) {
|
if (Object.keys(options).includes("token") && !options.token) {
|
||||||
throw new Error(`GitHub integration (${options.id}) token was undefined`);
|
throw `Can't create GitHub integration (${options.id}) as token was undefined`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.token) {
|
if (options.token) {
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ export class OpenAI
|
|||||||
|
|
||||||
constructor(private options: OpenAIIntegrationOptions) {
|
constructor(private options: OpenAIIntegrationOptions) {
|
||||||
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
||||||
throw new Error(
|
throw `Can't create OpenAI integration (${options.id}) as apiKey was undefined`;
|
||||||
`OpenAI integration (${options.id}) apiKey was undefined`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client = {
|
this.client = {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export class Plain implements PlainIntegration {
|
|||||||
|
|
||||||
constructor(private options: PlainIntegrationOptions) {
|
constructor(private options: PlainIntegrationOptions) {
|
||||||
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
||||||
throw new Error(`Plain integration (${options.id}) apiKey was undefined`);
|
throw `Can't create Plain integration (${options.id}) as apiKey was undefined`;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client = {
|
this.client = {
|
||||||
|
|||||||
@@ -57,9 +57,7 @@ export class Resend
|
|||||||
|
|
||||||
constructor(private options: ResendIntegrationOptions) {
|
constructor(private options: ResendIntegrationOptions) {
|
||||||
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
||||||
throw new Error(
|
throw `Can't create Resend integration (${options.id}) as apiKey was undefined`;
|
||||||
`Resend integration (${options.id}) apiKey was undefined`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client = {
|
this.client = {
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ export class Typeform implements TypeformIntegration {
|
|||||||
|
|
||||||
constructor(private options: TypeformIntegrationOptions) {
|
constructor(private options: TypeformIntegrationOptions) {
|
||||||
if (Object.keys(options).includes("token") && !options.token) {
|
if (Object.keys(options).includes("token") && !options.token) {
|
||||||
throw new Error(
|
throw `Can't create Typeform integration (${options.id}) as token was undefined`;
|
||||||
`Typeform integration (${options.id}) token was undefined`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.client = {
|
this.client = {
|
||||||
|
|||||||
Reference in New Issue
Block a user