NAME

WWW::Firecrawl::Error - structured error class for WWW::Firecrawl

VERSION

version 0.001

SYNOPSIS

die WWW::Firecrawl::Error->new(
  type        => 'api',
  message     => "HTTP 503: Service Unavailable",
  response    => $http_response,
  status_code => 503,
  attempt     => 3,
);

if (my $e = $@) {
  if (ref $e && $e->isa('WWW::Firecrawl::Error')) {
    warn "firecrawl failed at @{[ $e->type ]}: $e" if $e->is_api;
  }
}

type

One of transport, api, job, scrape, page. Required.

message

Human-readable error string. Required. The object stringifies to this.

response

The HTTP::Response object, when available.

data

The decoded JSON payload, when available.

status_code

For transport/api this is the HTTP status code of the Firecrawl response (0 for pure transport failures). For scrape/page this is data.metadata.statusCode of the target page. Undef for job.

url

Target URL for scrape and page errors.

attempt

1-based attempt counter, populated when retry was involved.

is_transport

is_api

is_job

is_scrape

is_page

Boolean accessors, each returns true when "type" matches.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-firecrawl/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudss.us/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.