opensea-js
Advanced tools
Comparing version 7.0.1 to 7.0.2
@@ -377,2 +377,14 @@ "use strict"; | ||
const response = await req.send(); | ||
if (!response.ok) { | ||
// If an errors array is returned, throw with the error messages. | ||
const errors = response.bodyJson?.errors; | ||
if (errors?.length > 0) { | ||
throw new Error(`Server Error: ${errors.join(", ")}`); | ||
} | ||
else { | ||
// Otherwise, let ethers throw a SERVER_ERROR since it will include | ||
// more context about the request and response. | ||
response.assertOk(); | ||
} | ||
} | ||
return response.bodyJson; | ||
@@ -379,0 +391,0 @@ } |
{ | ||
"name": "opensea-js", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -623,4 +623,15 @@ import { ethers } from "ethers"; | ||
const response = await req.send(); | ||
if (!response.ok) { | ||
// If an errors array is returned, throw with the error messages. | ||
const errors = response.bodyJson?.errors; | ||
if (errors?.length > 0) { | ||
throw new Error(`Server Error: ${errors.join(", ")}`); | ||
} else { | ||
// Otherwise, let ethers throw a SERVER_ERROR since it will include | ||
// more context about the request and response. | ||
response.assertOk(); | ||
} | ||
} | ||
return response.bodyJson; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
457090
11518