Git Product home page Git Product logo

Comments (3)

tobyink avatar tobyink commented on August 26, 2024

Wouldn't it make more sense to use $SIG{__DIE__} to log any exceptions? This would catch not only exceptions thrown by Type::Params, but also other exceptions that might come up like file errors, network errors, etc.

from p5-type-tiny.

jsf116 avatar jsf116 commented on August 26, 2024

The $SIG{__DIE__} approach is in many cases suitable, but there are two catches (well, they might be considered as two aspects of one and the same problem):

  1. This is too global relating to the application.
    If $SIG{__DIE__} is reset by some other module afterwards, the application behavior will no longer fit the expectations.
    Worse still, it is unclear at which time point this will happen and which behavior is currently active.
    And even the localization would not help because a foreign module called in the same scope can still change this signal handle if it does not localize $SIG{__DIE__}.
  2. This is too global relating to threads.
    Signals are in general not thread-safe and even though threads are officially discouraged in the recent Perl versions, we run some crucial multi-threading daemons developed in Perl and would like to improve them in a manner considering costs i.e. without being forced to provide a really radical step replacing threads with processes.

from p5-type-tiny.

tobyink avatar tobyink commented on August 26, 2024

1fbc5fe

from p5-type-tiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.