summaryrefslogtreecommitdiff
path: root/error.c
AgeCommit message (Collapse)Author
2022-06-20Include JIT information in crash reportsChris Seaton
Since enabling YJIT or MJIT drastically changes what could go wrong at runtime, it's good to be front and center about whether they are enabled when dumping a crash report. Previously, `RUBY_DESCRIPTION` and the description printed when crashing can be different when a JIT is on. Introduce a new internal data global, `rb_dynamic_description`, and set it to be the same as `RUBY_DESCRIPTION` during initialization; use it when crashing. * version.c: Init_ruby_description(): Initialize and use `rb_dynamic_description`. * error.c: Change crash reports to use `rb_dynamic_description`. * ruby.c: Call `Init_ruby_description()` earlier. Slightly more work for when we exit right after printing the description but that was deemed acceptable. * include/ruby/version.h: Talk about how JIT info is not in `ruby_description`. * test/-ext-/bug_reporter/test_bug_reporter.rb: Remove handling for crash description being different from `RUBY_DESCRIPTION`. * test/ruby/test_rubyoptions.rb: ditto Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Alan Wu <alanwu@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/5872
2022-06-20Allow to just warn as bool expected, without an exceptionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6039
2022-06-08[DOC] RDoc now accepts other than magic numbers at `rb_attr`Nobuyoshi Nakada
2022-06-07Revert "error.c: Let Exception#inspect inspect its message"Yusuke Endoh
This reverts commit 9d927204e7b86eb00bfd07a060a6383139edf741. Notes: Merged: https://github.com/ruby/ruby/pull/5981
2022-06-07error.c: Let Exception#inspect inspect its messageYusuke Endoh
... only when the message string has a newline. `p StandardError.new("foo\nbar")` now prints `#<StandardError: "foo\nbar">' instead of: #<StandardError: bar> [Bug #18170] Notes: Merged: https://github.com/ruby/ruby/pull/4857
2022-06-05Use RBOOLNobuyoshi Nakada
2022-05-21No fallback to default valuesNobuyoshi Nakada
2022-02-22Factor a "highlight" symbol outYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/5516
2022-02-22Let Exception#full_message pass highlight keywords to #detailed_messageYusuke Endoh
.. even when the argument is not explicitly passed. Notes: Merged: https://github.com/ruby/ruby/pull/5516
2022-02-22The default highlight arguments of Exception#detailed_message is falseYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/5516
2022-02-22Exception#detailed_message is addedYusuke Endoh
Also, the default error printer and Exception#full_message use the method instead of `Exception#message` to get the message string. `Exception#detailed_message` calls `Exception#message`, decorates and returns the result. It adds some escape sequences to highlight, and the class name of the exception to the end of the first line of the message. [Feature #18370] Notes: Merged: https://github.com/ruby/ruby/pull/5516
2022-02-22error.c: RefactoringYusuke Endoh
Factor out from rb_error_write the responsibility to check if stderr is a tty. Notes: Merged: https://github.com/ruby/ruby/pull/5516
2022-01-04Don't segfault if Warning.warn is undefinedJeremy Evans
Check that there is a method entry for the method before passing it to rb_method_entry_arity. Fixes [Bug #18458] Notes: Merged: https://github.com/ruby/ruby/pull/5391
2021-12-26Remove tainted and trusted featuresNobuyoshi Nakada
Already these had been announced to be removed in 3.2. Notes: Merged: https://github.com/ruby/ruby/pull/5348
2021-11-09Some codes replace to `RBOOL` macro (#5023)S.H
* Some code replace and using RBOOL macro * Fix indent * Using RBOOL in syserr_eqq function Notes: Merged-By: nobu <nobu@ruby-lang.org>
2021-10-30Add `rb_mod_exc_raise` function and replace duplicate codeS.H
Notes: Merged: https://github.com/ruby/ruby/pull/5063 Merged-By: nobu <nobu@ruby-lang.org>
2021-10-03Using NIL_P macro instead of `== Qnil`S.H
Notes: Merged: https://github.com/ruby/ruby/pull/4925 Merged-By: nobu <nobu@ruby-lang.org>
2021-09-15Refactor and Using RBOOL macroS.H
Notes: Merged: https://github.com/ruby/ruby/pull/4837 Merged-By: nobu <nobu@ruby-lang.org>
2021-09-10suppress GCC's -Wsuggest-attribute=format卜部昌平
I was not aware of this because I use clang these days. Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-09-10include/ruby/internal/error.h: add doxygen卜部昌平
Must not be a bad idea to improve documents. Notes: Merged: https://github.com/ruby/ruby/pull/4815
2021-08-15Show verbose error messages when single pattern match failsKazuki Tsujimoto
[0] => [0, *, a] #=> [0] length mismatch (given 1, expected 2+) (NoMatchingPatternError) Ignore test failures of typeprof caused by this change for now.
2021-08-14Get rid of unintented recursion when RUBY_DEBUGNobuyoshi Nakada
2021-08-14Mark internal class namesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4741
2021-08-14Add some "cold" marksNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4741
2021-08-14A comment for typed data in `rb_check_type` [ci skip]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4741
2021-08-02Using RBOOL macroS.H
Notes: Merged: https://github.com/ruby/ruby/pull/4695 Merged-By: nobu <nobu@ruby-lang.org>
2021-07-20Use UNREACHABLE instead of fall throughKazuhiro NISHIYAMA
2021-07-19Add `fall through`Kazuhiro NISHIYAMA
Pointed out by Coverity Scan ``` ** CID 1487522: Control flow issues (MISSING_BREAK) /error.c: 1273 in exc_full_message() ```
2021-07-18Make boolean expected messages more consitentNobuyoshi Nakada
2021-06-30Specify version to remove as bare numbersNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3972
2021-06-30Show the removal versionNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3972
2021-06-30rb_warn_deprecated_to_remove_at [Feature #17432]Nobuyoshi Nakada
At compilation time with RUBY_DEBUG enabled, check if the removal version has been reached. Notes: Merged: https://github.com/ruby/ruby/pull/3972
2021-04-30Fix example for custom warn methodAdam Daniels
Regexp has a match? method. [ci skip] Notes: Merged: https://github.com/ruby/ruby/pull/4236
2021-03-28Remove unneeded rb_ident_hash_new function declarationS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/4325
2021-03-28Fix segmentation fault when `Module#name` returns non string value [Bug #17754]Kenichi Kamiya
* Add test for NoMethodError#to_s does not segfault * Ensure no segfault even if Module#name is overridden Notes: Merged: https://github.com/ruby/ruby/pull/4328 Merged-By: nobu <nobu@ruby-lang.org>
2021-02-06Fix grammatical errorGaren Torikian
Notes: Merged: https://github.com/ruby/ruby/pull/4155
2021-02-01Implement NameError::message#clone for RactorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4142
2021-02-01Fixed varargs in `rb_bug_without_die` [Bug #17603]xtkoba (Tee KOBAYASHI)
2020-12-28Bypass check for warning_category on internal callsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4009
2020-12-23Make NoMatchingPatternError a subclass of StandardErrorKazuki Tsujimoto
2020-12-22Data: delete卜部昌平
Has been deprecated since 684bdf6171b76f5bc5e4f05926a5ab01ec2b4fd5. Matz says in [ruby-core:83954] that Data should be an alias of Object. Because rb_cData has not been deprecated, let us deprecate the constant to make it a C-level synonym of rb_cObject. Notes: Merged: https://github.com/ruby/ruby/pull/3961
2020-12-18Use category: :experimental in warnings that are related to experimental ↵Jeremy Evans
features This adds rb_category_compile_warn in order to emit compiler warnings with categories. Note that Ripper currently ignores the category for these warnings, but by default it ignores the warnings completely, so this shouldn't matter. Notes: Merged: https://github.com/ruby/ruby/pull/3917
2020-12-18Make warning_categories a map of category symbols to category numbersJeremy Evans
Use this to simplify rb_warning_category_from_name. This also adds support for using the :experimental category in Kernel#warn and Warning.warn. Notes: Merged: https://github.com/ruby/ruby/pull/3917
2020-12-18Switch rb_category_warn{,ing} to accept an rb_warning_category_tJeremy Evans
Since we decided to only allowing specific warning categories, there is no reason to have an API that accepts a general string, as it is more error-prone. Switch to only allowing the specific warning categories. As rb_category_warn{,ing} are public API, this requires making rb_warning_category_t public API as well. Notes: Merged: https://github.com/ruby/ruby/pull/3917
2020-12-15Cache warning category IDsNobuyoshi Nakada
2020-12-14Help RDoc find Exception [ci skip]Alan Wu
This was on top of `Init_Exception()`.
2020-12-08Supported category option in Warning#warnNobuyoshi Nakada
2020-12-08[DOC] Fixed RDoc directives [ci skip]v3_0_0_preview2Nobuyoshi Nakada
2020-11-26Call rb_bug_without_die on CITakashi Kokubun
when GC.compact's SEGV handler is installed
2020-10-26Ignore <internal: entries from core library methods for Kernel#warn(message, ↵Benoit Daloze
uplevel: n) * Fixes [Bug #17259] Notes: Merged: https://github.com/ruby/ruby/pull/3647