firecrawl 1.15.2 → 1.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -835,11 +835,13 @@ var FirecrawlApp = class {
835
835
  * @param {string} action - The action being performed when the error occurred.
836
836
  */
837
837
  handleError(response, action) {
838
- if ([402, 408, 409, 500].includes(response.status)) {
838
+ if ([400, 402, 408, 409, 500].includes(response.status)) {
839
839
  const errorMessage = response.data.error || "Unknown error occurred";
840
+ const details = response.data.details ? ` - ${JSON.stringify(response.data.details)}` : "";
840
841
  throw new FirecrawlError(
841
- `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`,
842
- response.status
842
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
843
+ response.status,
844
+ response.data.details
843
845
  );
844
846
  } else {
845
847
  throw new FirecrawlError(
package/dist/index.js CHANGED
@@ -799,11 +799,13 @@ var FirecrawlApp = class {
799
799
  * @param {string} action - The action being performed when the error occurred.
800
800
  */
801
801
  handleError(response, action) {
802
- if ([402, 408, 409, 500].includes(response.status)) {
802
+ if ([400, 402, 408, 409, 500].includes(response.status)) {
803
803
  const errorMessage = response.data.error || "Unknown error occurred";
804
+ const details = response.data.details ? ` - ${JSON.stringify(response.data.details)}` : "";
804
805
  throw new FirecrawlError(
805
- `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`,
806
- response.status
806
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
807
+ response.status,
808
+ response.data.details
807
809
  );
808
810
  } else {
809
811
  throw new FirecrawlError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "1.15.2",
3
+ "version": "1.15.3",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -1255,12 +1255,14 @@ export default class FirecrawlApp {
1255
1255
  * @param {string} action - The action being performed when the error occurred.
1256
1256
  */
1257
1257
  handleError(response: AxiosResponse, action: string): void {
1258
- if ([402, 408, 409, 500].includes(response.status)) {
1258
+ if ([400, 402, 408, 409, 500].includes(response.status)) {
1259
1259
  const errorMessage: string =
1260
1260
  response.data.error || "Unknown error occurred";
1261
+ const details = response.data.details ? ` - ${JSON.stringify(response.data.details)}` : '';
1261
1262
  throw new FirecrawlError(
1262
- `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`,
1263
- response.status
1263
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
1264
+ response.status,
1265
+ response.data.details
1264
1266
  );
1265
1267
  } else {
1266
1268
  throw new FirecrawlError(