summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
AgeCommit message (Collapse)Author
2017-09-27fix: src\error.c(76): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-08-12Reduce integer type mismatch warnings in VC.Yukihiro "Matz" Matsumoto
2017-08-11Should not call `to_str` in `mrb_vformat`; fix #3773Yukihiro "Matz" Matsumoto
2017-07-12Use "$!" specifier of `mrb_get_args`.Yukihiro "Matz" Matsumoto
2017-07-05Put a space between error position and error message.Yukihiro "Matz" Matsumoto
For readability's sake.
2017-06-14The out-of-memory error should not be an instance of RuntimeError.Yukihiro "Matz" Matsumoto
And arena-overflow error as well. They should not be caught by `rescue` by default.
2017-05-31Restore MRB_API function `mrb_exc_backtrace(mrb, exc)`; ref 9644ad5Yukihiro "Matz" Matsumoto
2017-05-23Simplify backtrace mechanism; fix #3633 #3634 #3644Yukihiro "Matz" Matsumoto
Instead of preserving a backtrace in `mrb_state`, `mrb_exc_set` keeps packed backtrace in an exception object. `#backtrace` unpacks it to an array of strings.
2017-05-23Support the case when the backtrace is not an array.Yukihiro "Matz" Matsumoto
2017-05-23Update comments regarding Exception#to_strYukihiro "Matz" Matsumoto
2017-04-25Avoid use of `snprintf()` when DISABLE_STDIO is set; fix #3632Yukihiro "Matz" Matsumoto
ref #3492 #3515 #3517
2017-04-18Call exc_debug_info() in mrb_exc_set(); ref #3610Yukihiro "Matz" Matsumoto
Otherwise line number information is lacked from exceptions raised in VM, e.g. "super called outside of method".
2017-03-19Fixed some compiler errors regarding PRId.Yukihiro "Matz" Matsumoto
2017-03-19Use MRB_PRId instead of "%d"; fix #3515Yukihiro "Matz" Matsumoto
2017-03-19Remove cname duplication from exc_inspect().Yukihiro "Matz" Matsumoto
2017-03-19Avoid possible infinite recursion in mrb_print_error(); ref #3517Yukihiro "Matz" Matsumoto
2017-03-18Save/restore GC arena index to avoid arena overflow error.Yukihiro "Matz" Matsumoto
2017-03-18Avoid mrb_check_string_type() in raising exception; fix #3506Yukihiro "Matz" Matsumoto
The change may reduce flexibility, but I believe no one wants that level of flexibility here.
2017-03-02Create NoMethodError instance using `mrb_obj_new()`.Yukihiro "Matz" Matsumoto
2017-02-15Do not funcall() Exception#set_backtrace from runtime.Yukihiro "Matz" Matsumoto
This change reduce flexibility but makes mruby simpler and faster.
2017-02-15Preallocate SystemStackError; ref #3421Yukihiro "Matz" Matsumoto
2017-01-23Backtrace list must be an array of strings; fix #3408Yukihiro "Matz" Matsumoto
2017-01-12Merge pull request #3393 from clayton-shopify/fix-exc-initializeYukihiro "Matz" Matsumoto
Fix broken MRB_INT64
2017-01-11Fix 36fc1f14 not checking in the right locationBouke van der Bijl
2017-01-11Use mrb_int for argc.Clayton Smith
2017-01-11Exception#initialize to take arbitrary number of args; ref #3384Yukihiro "Matz" Matsumoto
2016-11-28pre-allocate arena overflow errorYukihiro "Matz" Matsumoto
2016-11-27Added Exception check in mrb_exc_set(); close #3292Yukihiro "Matz" Matsumoto
PR #3293 just checks for NoMethodError.
2016-03-06Fix segmentation fault by backtrace and GCKouhei Sutou
GitHub: fix #3122 It reverts #3126. #3126 fixes the segmentation fault but generates broken backtrace. This change fixes the segmentation fault and generates correct backtrace. The strategy of this change is "generating backtrace while irep is alive". /tmp/test.rb: def gen e0 = nil begin 1.times { raise 'foobar' } rescue => e e0 = e end e0 end e = gen GC.start gen GC.start puts e.backtrace.join("\n") Run: % bin/mruby /tmp/test.rb /tmp/test.rb:5:in Object.gen /home/kou/work/ruby/mruby.kou/mrblib/numeric.rb:77:in Integral#times /tmp/test.rb:4:in Object.gen /tmp/test.rb:13 FYI: % ruby -v /tmp/test.rb ruby 2.3.0p0 (2015-12-25) [x86_64-linux-gnu] /tmp/test.rb:5:in `block in gen' /tmp/test.rb:4:in `times' /tmp/test.rb:4:in `gen' /tmp/test.rb:13:in `<main>'
2015-12-29Support backtrace after method callsKouhei Sutou
GitHub: fix #2902, #2917 The current implementation traverses stack to retrieve backtrace. But stack will be changed when some operations are occurred. It means that backtrace may be broken after some operations. This change (1) saves the minimum information to retrieve backtrace when exception is raised and (2) restores backtrace from the minimum information when backtrace is needed. It reduces overhead for creating backtrace Ruby objects. The space for the minimum information is reused by multiple exceptions. So memory allocation isn't occurred for each exception.
2015-12-29Fix indentKouhei Sutou
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-11-17DISABLE_STDIO/ENABLE_DEBUG macros to rename; close #3014Yukihiro "Matz" Matsumoto
changes: * rename DISABLE_STDIO -> MRB_DISABLE_STDIO * rename ENABLE_DEBUG -> MRB_ENABLE_DEBUG_HOOK * no more opposite macro definitions (e.g. ENABLE_STDIO, DISABLE_DEBUG). * rewrite above macro references throughout the code. * update documents
2015-10-19Clean up GC codefurunkel
2015-07-16use mrb_str_cat_str() instead of mrb_str_append()cremno
If the argument is always a string, then mrb_str_cat_str() can be directly called instead of indirectly by mrb_str_append(). mrb_any_to_s(), mrb_obj_as_string(), mrb_inspect() always return a string.
2015-07-13refactor mrb_bob_missing to share raising NoMethodError code; fix #2878Yukihiro "Matz" Matsumoto
Note: arguments of mrb_no_method_error() has changed. You need to replace 3rd and 4th argument (say n, argv) to mrb_ary_new_from_values(mrb, n, argv).
2015-05-25Move "src/mrb_throw.h" to "include/mruby/throw.h".take_cheeze
Related to #2760.
2015-05-18fix type of mrb_exc_new()'s len parametercremno
mrb_str_new() takes size_t, so should mrb_exc_new().
2015-01-03Use mrb_exc_new_str_lit().Tatsuhiko Kubo
2014-08-27Add a missing space after ",".Tatsuhiko Kubo
2014-08-04add MRB_API modifiers to mruby API functionsYukihiro "Matz" Matsumoto
2014-07-28Use RString in `mesg` instead.take_cheeze
2014-07-28Store exception message to `mesg` field of `struct RException`.take_cheeze
2014-07-21Use MRB_TT_EXCEPTION in exception object.take_cheeze
2014-07-12use SystemStackError instead of RuntimeErrorYukihiro "Matz" Matsumoto
2014-06-27initialize nomem_err->mesg->c before exposing to Ruby world; close #2428Yukihiro "Matz" Matsumoto
2014-06-27reduce mrb_funcall in exception allocationYukihiro "Matz" Matsumoto
2014-06-04indent ISO section commentsYukihiro "Matz" Matsumoto
2014-06-04use pre-allocated RuntimeError for out-of-memoryYukihiro "Matz" Matsumoto
2014-06-02Implement `NoMethodError#args`.take_cheeze