Method: ALib::AbstractMain#logcatch
- Defined in:
- lib/alib-0.5.1/main.rb
#logcatch ⇒ Object
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/alib-0.5.1/main.rb', line 474 def logcatch #--{{{ ret = nil # @logger ||= Logger::new STDERR logger! begin ret = yield rescue Exception => e unless SystemExit === e fatal{ e } exit EXIT_FAILURE if false if logger.debug? fatal{ e } exit EXIT_FAILURE else fatal{ emsg(e) } exit EXIT_FAILURE end end else exit e.status end end ret #--}}} end |