Project

General

Profile

Actions

Feature #11347

open

Errors with cause not reported properly to console

Added by akostadinov (Aleksandar Kostadinov) over 9 years ago. Updated over 9 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:69953]

Description

Hello, errors with cause are an important and very useful feature for debugging. It seems though default reporting is not showing the cause and nested causes to user. Here's a test file:

raise "GAHGAH" rescue raise "error with cause" rescue e=$!

puts "Error: #{e}"
puts "Cause: #{e.cause}"

raise e

As you can see, the cause of the error is not printed in any way to the console when error is raised:

$ ruby /tmp/test.rb 
Error: error with cause
Cause: GAHGAH
/tmp/test.rb:1:in `rescue in <main>': error with cause (RuntimeError)
	from /tmp/test.rb:1:in `<main>

Related issues 1 (1 open0 closed)

Is duplicate of Ruby master - Feature #9918: Exception#cause should be shown in output and #inspectOpenActions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Is duplicate of Feature #9918: Exception#cause should be shown in output and #inspect added

Updated by nobu (Nobuyoshi Nakada) over 9 years ago

  • Tracker changed from Bug to Feature
  • Description updated (diff)

Updated by akostadinov (Aleksandar Kostadinov) over 9 years ago

I rather think it is actually a bug because it hides very important information from the user. It's like showing your error cut in half or on more pieces. It's just confusing to use causes this way. So I call it a bug as the initial feature implementation is somehow broken.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0