Exception: Zstd::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Zstd::Error
- Includes:
- Exceptions
- Defined in:
- ext/extzstd.c
Instance Method Summary collapse
- #error_code ⇒ Object (also: #errcode)
- #initialize(argv[], err) ⇒ Object constructor
- #to_s ⇒ Object
Constructor Details
#initialize(argv[], err) ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 |
# File 'ext/extzstd.c', line 106
static VALUE
err_initialize(int argc, VALUE argv[], VALUE err)
{
VALUE errcode;
rb_scan_args(argc, argv, "1*", &errcode, NULL);
rb_call_super(argc - 1, argv + 1);
rb_ivar_set(err, id_error_code, errcode);
return err;
}
|
Instance Method Details
#error_code ⇒ Object Also known as: errcode
118 119 120 121 122 |
# File 'ext/extzstd.c', line 118
static VALUE
err_errcode(VALUE err)
{
return rb_ivar_get(err, id_error_code);
}
|
#to_s ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'ext/extzstd.c', line 124
static VALUE
err_to_s(VALUE err)
{
ZSTD_ErrorCode code = (ZSTD_ErrorCode)NUM2SSIZET(rb_ivar_get(err, id_error_code));
VALUE mesg = rb_call_super(0, NULL);
VALUE mesg2 = rb_sprintf(" - %s (errcode: %d)", ZSTD_getErrorString(code), (int)code);
return rb_str_plus(mesg, mesg2);
}
|