You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@typespec/ts-http-runtime

Package Overview
Dependencies
Maintainers
1
Versions
284
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@typespec/ts-http-runtime - npm Package Compare versions

Comparing version

to
1.0.0-alpha.20231129.4

18

dist-esm/src/client/restError.js

@@ -5,10 +5,14 @@ // Copyright (c) Microsoft Corporation.

import { createHttpHeaders } from "../httpHeaders";
/**
* Creates a rest error from a PathUnchecked response
*/
export function createRestError(message, response) {
export function createRestError(messageOrResponse, response) {
var _a;
const resp = typeof messageOrResponse === "string" ? response : messageOrResponse;
const internalError = resp.body.error || resp.body;
const message = typeof messageOrResponse === "string"
? messageOrResponse
: (_a = internalError.message) !== null && _a !== void 0 ? _a : `Unexpected status code: ${resp.status}`;
return new RestError(message, {
statusCode: statusCodeToNumber(response.status),
request: response.request,
response: toPipelineResponse(response),
statusCode: statusCodeToNumber(resp.status),
code: internalError.code,
request: resp.request,
response: toPipelineResponse(resp),
});

@@ -15,0 +19,0 @@ }

{
"name": "@typespec/ts-http-runtime",
"version": "1.0.0-alpha.20231121.3",
"version": "1.0.0-alpha.20231129.4",
"description": "Isomorphic client library for making HTTP requests in node.js and browser.",

@@ -5,0 +5,0 @@ "sdk-type": "client",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display