cro-unhandlederrorreporter

Cro::UnhandledErrorReporter

The unhandled error reporting mechanism is used when an exception occurs and there is nothing in place to handle it, and so it propagates to the sink of a pipeline. In HTTP applications these errors occur at a connection or request level, rather than affecting the service as a whole.

The default erorr reporter dumps the exception and backtrace to the standard error stream. You may provide your own unhandled error reporter if you wish to, for example, output the error using some kind of logging framework.

This is a process-level mechanism.

Setting an unhandled error reporter

A set-unhandled-error-reporter sub is exported by the module. Call it with a block, which will be passed an Exception as an argument.

use Cro::UnhandledErrorReporter;
set-unhandled-error-reporter -> $exception {
    note "OH NO!!!\n" ~ $exception.gist();
}

Reporting an unhandled error

Note: This mechanism is only intended for those implementing Cro pipeline components, and for situations where the error cannot be better communicated.

Call the report-unhandled-error sub, passing an Exception, in order to report it using the registered handler.

cro v0.8.8

Libraries and tools for building reactive services in Raku. This installs the cro command line and web tool, along with HTTP (including HTTPS and HTTP/2.0) and WebSocket support.

Authors

  • Jonathan Worthington

License

Artistic-2.0

Dependencies

IO::Socket::Async::SSLJSON::FastMETA6Shell::CommandFile::FindTerminal::ANSIColorOO::MonitorsYAMLishCro::WebSocket:ver<0.8.8>Docker::FileFile::Ignore

Test Dependencies

Provides

  • Cro::Tools::CLI
  • Cro::Tools::CroFile
  • Cro::Tools::Link::Editor
  • Cro::Tools::LinkTemplate
  • Cro::Tools::LinkTemplate::HTTP
  • Cro::Tools::LinkTemplate::HTTPS
  • Cro::Tools::LinkTemplate::WS
  • Cro::Tools::LinkTemplate::WSS
  • Cro::Tools::Runner
  • Cro::Tools::Serve
  • Cro::Tools::Services
  • Cro::Tools::Template
  • Cro::Tools::Template::Common
  • Cro::Tools::Template::HTTPService
  • Cro::Tools::Template::ReactReduxSPA
  • Cro::Tools::Template::ZeroMQWorkSinkService
  • Cro::Tools::Template::ZeroMQWorkerService
  • Cro::Tools::TemplateLocator
  • Cro::Tools::Web

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.