Skip to content

Commit 302410b

Browse files
committedJan 9, 2025·
Add support for GRN_BLOSC_ERROR
1 parent 6b85451 commit 302410b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed
 

‎ext/groonga/rb-grn-exception.c

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
22
/*
3-
Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
3+
Copyright (C) 2009-2025 Sutou Kouhei <kou@clear-code.com>
44
Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
55
66
This library is free software; you can redistribute it and/or
@@ -104,6 +104,7 @@ static VALUE eGrnCancel;
104104
static VALUE eGrnWindowFunctionError;
105105
static VALUE eGrnZstdError;
106106
static VALUE eGrnConnectionReset;
107+
static VALUE eGrnBloscError;
107108

108109
VALUE
109110
rb_grn_rc_to_exception (grn_rc rc)
@@ -357,6 +358,11 @@ rb_grn_rc_to_exception (grn_rc rc)
357358
case GRN_CONNECTION_RESET:
358359
exception = eGrnConnectionReset;
359360
break;
361+
#if GRN_VERSION_OR_LATER(13, 0, 8)
362+
case GRN_BLOSC_ERROR:
363+
exception = eGrnBloscError;
364+
break;
365+
#endif
360366
}
361367

362368
if (NIL_P(exception))
@@ -1086,4 +1092,16 @@ rb_grn_init_exception (VALUE mGrn)
10861092
*/
10871093
eGrnConnectionReset =
10881094
rb_define_class_under(mGrn, "ConnectionReset", rb_eGrnError);
1095+
1096+
#if GRN_VERSION_OR_LATER(13, 0, 8)
1097+
/*
1098+
* Document-class: Groonga::BloscError
1099+
*
1100+
* It is used when Blosc reports an error.
1101+
*
1102+
* @since 14.1.2
1103+
*/
1104+
eGrnBloscError =
1105+
rb_define_class_under(mGrn, "BloscError", rb_eGrnError);
1106+
#endif
10891107
}

0 commit comments

Comments
 (0)
Please sign in to comment.