Skip to content

Commit

Permalink
- fixes error throw in typescript request adapter
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
  • Loading branch information
baywet committed Feb 4, 2022
1 parent 238338f commit 3bbb58d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions abstractions/typescript/src/apiError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export class ApiError implements Error {
public stack?: string;
public constructor(message?: string) {
this.message = message || "";
this.name = "ApiError";
}
}
2 changes: 1 addition & 1 deletion http/typescript/fetch/src/fetchRequestAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class FetchRequestAdapter implements RequestAdapter {
const rootNode = await this.getRootParseNode(response);
const error = rootNode.getObjectValue(factory);

if(error instanceof Error) throw error;
if(error) throw error;
else throw new ApiError("unexpected error type" + typeof(error))
}
private getHttpResponseMessage = async (requestInfo: RequestInformation): Promise<Response> => {
Expand Down

0 comments on commit 3bbb58d

Please sign in to comment.