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
|
||||
): IntegrationClient<Octokit, typeof tasks> {
|
||||
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) {
|
||||
|
||||
@@ -10,9 +10,7 @@ export class OpenAI
|
||||
|
||||
constructor(private options: OpenAIIntegrationOptions) {
|
||||
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
||||
throw new Error(
|
||||
`OpenAI integration (${options.id}) apiKey was undefined`
|
||||
);
|
||||
throw `Can't create OpenAI integration (${options.id}) as apiKey was undefined`;
|
||||
}
|
||||
|
||||
this.client = {
|
||||
|
||||
@@ -18,7 +18,7 @@ export class Plain implements PlainIntegration {
|
||||
|
||||
constructor(private options: PlainIntegrationOptions) {
|
||||
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 = {
|
||||
|
||||
@@ -57,9 +57,7 @@ export class Resend
|
||||
|
||||
constructor(private options: ResendIntegrationOptions) {
|
||||
if (Object.keys(options).includes("apiKey") && !options.apiKey) {
|
||||
throw new Error(
|
||||
`Resend integration (${options.id}) apiKey was undefined`
|
||||
);
|
||||
throw `Can't create Resend integration (${options.id}) as apiKey was undefined`;
|
||||
}
|
||||
|
||||
this.client = {
|
||||
|
||||
@@ -35,9 +35,7 @@ export class Typeform implements TypeformIntegration {
|
||||
|
||||
constructor(private options: TypeformIntegrationOptions) {
|
||||
if (Object.keys(options).includes("token") && !options.token) {
|
||||
throw new Error(
|
||||
`Typeform integration (${options.id}) token was undefined`
|
||||
);
|
||||
throw `Can't create Typeform integration (${options.id}) as token was undefined`;
|
||||
}
|
||||
|
||||
this.client = {
|
||||
|
||||
Reference in New Issue
Block a user