Skip to content

Commit 33b0491

Browse files
committed
fix: throw errors properly and fix logger
1 parent 1943f81 commit 33b0491

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/logger/logger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export class Logger {
168168
const commonOptions = {
169169
name: options.name ?? Logger.ROOT_NAME,
170170
base: options.fields ?? {},
171+
level,
171172
enabled,
172173
...(Global.isWeb ? { browser: { asObject: true } } : {}),
173174
};

src/webOAuthServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,17 @@ export class WebOAuthServer extends AsyncCreatable<WebOAuthServer.Options> {
201201
const env = new Env();
202202

203203
if (env.getBoolean('CODE_BUILDER')) {
204-
if (this.oauthConfig.clientId !== CODE_BUILDER_CONNECTED_APP_INFO.clientId) {
204+
if (this.oauthConfig.clientId && this.oauthConfig.clientId !== CODE_BUILDER_CONNECTED_APP_INFO.clientId) {
205205
this.logger.warn(messages.getMessage('invalidClientId', [this.oauthConfig.clientId]));
206206
}
207207
this.oauthConfig.clientId = CODE_BUILDER_CONNECTED_APP_INFO.clientId;
208208
const cbUri = env.getString('CODE_BUILDER_URI');
209209
if (!cbUri) {
210-
messages.createError('error.missingCodeBuilderUri');
210+
throw messages.createError('error.missingCodeBuilderUri');
211211
}
212212
const cbStateSha = env.getString('CODE_BUILDER_STATE_SHA');
213213
if (!cbStateSha) {
214-
messages.createError('error.missingCodeBuilderStateSha');
214+
throw messages.createError('error.missingCodeBuilderStateSha');
215215
}
216216
this.oauthConfig.state = JSON.stringify({
217217
PORT: port,

0 commit comments

Comments
 (0)