aboutsummaryrefslogtreecommitdiffstats
path: root/error.c
Commit message (Collapse)AuthorAgeFilesLines
* * error.c (rb_load_fail): should honor encoding.nobu2012-03-071-10/+17
| | | | | | * load.c (load_failed): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rb_load_failnobu2012-03-071-2/+2
| | | | | | | | * error.c (rb_load_fail): use path as a string, not char*. * internal.h: (rb_load_fail): moved from ruby/intern.h. * ruby.c (load_file_internal): fname cannot be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_loaderror_with_path): Adding the missing file as antenderlove2012-03-061-2/+23
| | | | | | | | | | | | | | | | | instance variable to the LoadError exception. * load.c: call rb_loaderror_with_path so that the missing path is added to the exception. * ruby.c: call rb_loaderror rather than raising our own LoadError exception. * include/ruby/intern.h: add declaration for rb_loaderror_with_path. * test/ruby/test_require.rb: add supporting test for LoadError#path method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (report_bug): use buf and snprintf to avoid consuming stack.naruse2012-02-251-2/+5
| | | | | | [ruby-dev:45272] [Bug #6058] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dir.c (dir_initialize): keep path in original encoding.nobu2012-02-241-6/+4
| | | | | | | | * error.c (syserr_initialize): prefer the encoding of message over locale. [ruby-dev:45279][Bug #6071] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: new functions to deal exceptions with string instances.nobu2012-02-241-0/+48
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exc_inspect): Fix typo. patch from Trent Ogrenayumin2012-02-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exc_equal): clear rb_thread_t::errinfo when ignorenagachika2012-01-141-1/+4
| | | | | | an exception under rb_protect(). [ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exc_equal): ignore exceptions during implicitnobu2012-01-141-0/+12
| | | | | | conversion. [ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "* error.c (exc_equal): try implicit conversion for delegator."naruse2012-01-131-5/+1
| | | | | | | | | This reverts commit r34291 because it breaks objects whose "exception" method doesn't allow no argument like XMLRPC::FaultException class. To reproduce: `RuntimeError.new == XMLRPC::FaultException`. [ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exc_equal): try implicit conversion for delegator.nobu2012-01-131-1/+5
| | | | | | | [ruby-core:41979] [Bug #5865] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (builtin_type_name): don't return pointer to the buffer ofnagachika2011-12-151-3/+5
| | | | | | temporary String object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_check_type): fix typo.nobu2011-12-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_check_typeddata): refine error message withnobu2011-12-151-17/+27
| | | | | | | including expected struct name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (name_err_mesg_to_str): clear rb_thread_t::errinfo whennagachika2011-12-131-1/+4
| | | | | | | | | ignore exception under rb_protect(). * test/ruby/test_exception.rb (test_exception_in_name_error_to_str): add a corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exit_initialize): deal with true and false as well asnobu2011-12-111-5/+35
| | | | | | | Kernel#exit. [ruby-dev:44951] [Bug #5728] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update doc and add test for SystemExit.new.akr2011-12-081-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (Init_Exception): Document $! and $@. Providedrbrain2011-10-191-8/+38
| | | | | | | recommendations for creating exceptions for a library. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (Init_Exception): Add hierarchy of Exception subclasses.drbrain2011-10-191-0/+32
| | | | | | | Based on patch by Sylvain Daubert. [Ruby 1.9 - Bug #5438] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-1/+1
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (report_bug): use a small message buffer instead of BUFSIZ.kosaki2011-08-041-2/+3
| | | | | | | | | | | It is needed for avoiding nested SIGSEGV on Linux. Note: BUFSIZ is not proper buffer size. It's unrelated with maximum filename length. :-/ [Bug #5139] [ruby-dev:44315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_name_error_str): new function to raise NameErrornobu2011-07-231-0/+15
| | | | | | | | with the name string but not ID. * object.c, proc.c, variable.c: more removal of inadvertent symbol creation. [Feature #5079] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_check_trusted): new function to check an object isnobu2011-07-171-0/+16
| | | | | | | | trusted. * struct.c (rb_struct_modify), time.c (time_modify): check by the above function to show proper class names. [Bug #5036] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_warn_m): accept multiple args in like puts. rdocnobu2011-07-171-8/+15
| | | | | | patch by Erik Price at [ruby-core:38119]. [Feature #5029] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_bug): get rid of segfault after all threadsnobu2011-07-081-1/+8
| | | | | | | disposed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c, thread_pthread.c (WRITE_CONST): suppress warningsnobu2011-06-301-5/+7
| | | | | | `ignoring return value'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cmath.rb: Hide handle_no_method_error from RDoc.drbrain2011-06-301-0/+18
| | | | | | | * error.c: Document or hide undocumented error classes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_async_bug_errno): async-safe bug report function.ko12011-06-281-6/+40
| | | | | | | | | | | | | In timer thread, signal handler shoul use it. The patch is contributed by Eric Wong <normalperson@yhbt.net>. Refs: [ruby-core:37644] and [ruby-core:37647] * thread_pthread.c: use rb_async_bug_errno(). And replace all fprintf() to write(). * internal.h (rb_async_bug_errno): add decl. of above func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prevent temporary objects from GC, and should not usenobu2011-02-201-1/+2
| | | | | | | RSTRING_PTR() for function calls since it evaluates the argument a couple of times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_invalid_str): prevent intermediate variable from GC.nobu2011-01-241-1/+1
| | | | | | [ruby-core:34820] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Exception#to_s should actually call to_s.ryan2011-01-121-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Error#to_s should ensure that the value returned is a string.ryan2011-01-051-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_expr_str): need to escape if the coderage is invalid.usa2010-12-281-5/+18
| | | | | | | | | | | * error.c, include/ruby/intern.h (rb_compile_error_with_enc): new function to raise syntax error, with source encoding'ed message. * parse.y (compile_error): use above function. [ruby-core:33951] (#4217) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_check_type): check for type from extensions for rubynobu2010-12-231-1/+4
| | | | | | 1.8. see [ruby-core:33797]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: Fix build error for win32. This regression waskosaki2010-12-201-0/+8
| | | | | | | | introduced by r30271. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exit_success_p): Check status code more carefully.kosaki2010-12-201-3/+9
| | | | | | | | status code may have garbage in upper bit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: parenthesize macro arguments.akr2010-12-121-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_syserr_new): new function to make SystemCallErrornobu2010-11-081-1/+20
| | | | | | | instance without errno. [EXPERIMENTAL] * error.c (rb_syserr_fail, rb_mod_syserr_fail): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h (rb_check_frozen): optimize.nobu2010-10-241-1/+2
| | | | | | | | [ruby-core:32878] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_body), error.c (set_syserr, get_syserr),nobu2010-10-121-3/+5
| | | | | | | | | | | | | | (syserr_initialize), gc.c (define_final, rb_gc_copy_finalizer), (run_final), hash.c (rb_hash_aref, rb_hash_lookup2), (rb_hash_fetch_m, rb_hash_clear, rb_hash_aset, eql_i), iseq.c (iseq_load, iseq_data_to_ary), marshal.c (r_symlink), thread.c (rb_thread_local_aref), variable.c (generic_ivar_remove, ivar_get, rb_const_get_0), (rb_cvar_get), vm.c (rb_vm_check_redefinition_opt_method), vm_insnhelper.c (vm_get_ev_const), vm_method.c (remove_method), ext/iconv/iconv.c (map_charset): use st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (exc_to_s): use OBJ_INFECT.naruse2010-10-121-4/+4
| | | | | | | | | | * error.c (name_err_to_s): ditto. * error.c (name_err_mesg_to_str): ditto. * error.c (syserr_initialize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (syserr_initialize): taint message if mesg is givennaruse2010-10-121-0/+1
| | | | | | and it is tainted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (syserr_initialize): use mesg's encoding when localenaruse2010-10-111-1/+8
| | | | | | | encoding is US-ASCII. If locale encoding is not US-ASCII, assume err has non ASCII characters. [ruby-dev:42358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (syserr_initialize): set the encoding of Errno::*#messagenaruse2010-10-111-0/+1
| | | | | | as locale. [ruby-dev:42358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-5/+17
| | | | | | | | add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_bug): existance of _set_abort_behavior() depends onusa2010-06-161-1/+1
| | | | | | | runtime version, not compiler version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_name_err_mesg_new): guard mesg, recv and method.akr2010-06-051-1/+6
| | | | | | | The problem in [ruby-dev:41464] is caused because mesg is collected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * removed trailing spaces.nobu2010-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (rb_bug): suppress the error report dialog if report_bug() tarui2010-05-271-0/+4
| | | | | | | is finished successfly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e