summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-29 03:56:22 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-29 03:56:22 +0000
commitd50547c22c5a884d90d434adef20a9217d88da22 (patch)
tree9b06164a3e7662cd4bcdb49854cf1ac9ace1d291 /error.c
parent685a063a15d8f18b2f4c849b1faa1158e614eaba (diff)
Add RDoc for Kernel global functions, tidy array and error
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/error.c b/error.c
index 3f48c85..dcf76d8 100644
--- a/error.c
+++ b/error.c
@@ -162,6 +162,14 @@ rb_warning(fmt, va_alist)
va_end(args);
}
+/*
+ * call-seq:
+ * warn(msg) => nil
+ *
+ * Display the given message (followed by a newline) on STDERR unless
+ * warnings are disabled (for example with the <code>-W0</code> flag).
+ */
+
static VALUE
rb_warn_m(self, mesg)
VALUE self, mesg;
@@ -517,6 +525,13 @@ exc_set_backtrace(exc, bt)
return rb_iv_set(exc, "bt", check_backtrace(bt));
}
+/*
+ * call-seq:
+ * SystemExit.new(status=0) => system_exit
+ *
+ * Create a new +SystemExit+ exception with the given status.
+ */
+
static VALUE
exit_initialize(argc, argv, exc)
int argc;
@@ -533,6 +548,15 @@ exit_initialize(argc, argv, exc)
return exc;
}
+
+/*
+ * call-seq:
+ * system_exit.status => fixnum
+ *
+ * Return the status value associated with this system exit.
+ */
+
+
static VALUE
exit_status(exc)
VALUE exc;
@@ -564,6 +588,15 @@ rb_name_error(id, fmt, va_alist)
rb_exc_raise(exc);
}
+/*
+ * call-seq:
+ * NameError.new(msg [, name]) => name_error
+ *
+ * Construct a new NameError exception. If given the <i>name</i>
+ * parameter may subsequently be examined using the <code>NameError.name</code>
+ * method.
+ */
+
static VALUE
name_err_initialize(argc, argv, self)
int argc;
@@ -578,6 +611,13 @@ name_err_initialize(argc, argv, self)
return self;
}
+/*
+ * call-seq:
+ * name_error.name => string or nil
+ *
+ * Return the name associated with this NameError exception.
+ */
+
static VALUE
name_err_name(self)
VALUE self;
@@ -585,6 +625,16 @@ name_err_name(self)
return rb_attr_get(self, rb_intern("name"));
}
+/*
+ * call-seq:
+ * NoMethodError.new(msg, name [, args]) => no_method_error
+ *
+ * Contruct a NoMethodError exception for a method of the given name
+ * called with the given arguments. The name may be accessed using
+ * the <code>#name</code> method on the resulting object, and the
+ * arguments using the <code>#args</code> method.
+ */
+
static VALUE
nometh_err_initialize(argc, argv, self)
int argc;
@@ -597,6 +647,14 @@ nometh_err_initialize(argc, argv, self)
return self;
}
+/*
+ * call-seq:
+ * no_method_error.args => obj
+ *
+ * Return the arguments passed in as the third parameter to
+ * the constructor.
+ */
+
static VALUE
nometh_err_args(self)
VALUE self;
@@ -679,6 +737,17 @@ get_syserr(n)
return error;
}
+/*
+ * call-seq:
+ * SystemCallError.new(msg, errno) => system_call_error_subclass
+ *
+ * If _errno_ corresponds to a known system error code, constructs
+ * the appropriate <code>Errno</code> class for that error, otherwise
+ * constructs a generic <code>SystemCallError</code> object. The
+ * error number is subsequently available via the <code>errno</code>
+ * method.
+ */
+
static VALUE
syserr_initialize(argc, argv, self)
int argc;
@@ -726,6 +795,13 @@ syserr_initialize(argc, argv, self)
return self;
}
+/*
+ * call-seq:
+ * system_call_error.errno => fixnum
+ *
+ * Return this SystemCallError's error number.
+ */
+
static VALUE
syserr_errno(self)
VALUE self;
@@ -733,6 +809,15 @@ syserr_errno(self)
return rb_attr_get(self, rb_intern("errno"));
}
+/*
+ * call-seq:
+ * system_call_error === other => true or false
+ *
+ * Return +true+ if the receiver is a generic +SystemCallError+, or
+ * if the error numbers _self_ and _other_ are the same.
+ */
+
+
static VALUE
syserr_eqq(self, exc)
VALUE self, exc;