Skip to content

Commit

Permalink
fix(server-context): compatible with new logger api
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd committed Oct 23, 2023
1 parent 77db656 commit 916db77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/server-context/src/api-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export abstract class AlwatrApiRequestBase<
const responseJson = this._responseJson!;
if (responseJson.ok !== true) {
if (typeof responseJson.errorCode === 'string') {
this._logger.accident('_$fetch', responseJson.errorCode, 'fetch response not ok', {responseJson});
this._logger.accident('_$fetch', responseJson.errorCode, {responseJson});
throw new Error(responseJson.errorCode);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion packages/server-context/src/server-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export abstract class AlwatrServerContextBase<

protected _$updateContextAction(): void {
if (this._responseJson === undefined) {
this._logger.accident('_$updateContextAction', 'no_response_json', 'this._responseJson undefined');
this._logger.accident('_$updateContextAction', 'no_response_json');
return;
}

Expand Down
3 changes: 3 additions & 0 deletions packages/server-context/src/server-request.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import {fetch} from '@alwatr/fetch';
import {ActionRecord, FiniteStateMachineBase, StateRecord} from '@alwatr/fsm';
import {definePackage} from '@alwatr/logger';

import type {FetchOptions} from '@alwatr/fetch/type.js';

definePackage('server-context', '2.x');

export interface ServerRequestConfig extends Partial<FetchOptions> {
name: string;
}
Expand Down

0 comments on commit 916db77

Please sign in to comment.