Skip to content

Commit

Permalink
Add support for GRN_BLOSC_ERROR
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 9, 2025
1 parent 6b85451 commit 302410b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ext/groonga/rb-grn-exception.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2009-2016 Kouhei Sutou <[email protected]>
Copyright (C) 2009-2025 Sutou Kouhei <[email protected]>
Copyright (C) 2014-2016 Masafumi Yokoyama <[email protected]>
This library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -104,6 +104,7 @@ static VALUE eGrnCancel;
static VALUE eGrnWindowFunctionError;
static VALUE eGrnZstdError;
static VALUE eGrnConnectionReset;
static VALUE eGrnBloscError;

VALUE
rb_grn_rc_to_exception (grn_rc rc)
Expand Down Expand Up @@ -357,6 +358,11 @@ rb_grn_rc_to_exception (grn_rc rc)
case GRN_CONNECTION_RESET:
exception = eGrnConnectionReset;
break;
#if GRN_VERSION_OR_LATER(13, 0, 8)
case GRN_BLOSC_ERROR:
exception = eGrnBloscError;
break;
#endif
}

if (NIL_P(exception))
Expand Down Expand Up @@ -1086,4 +1092,16 @@ rb_grn_init_exception (VALUE mGrn)
*/
eGrnConnectionReset =
rb_define_class_under(mGrn, "ConnectionReset", rb_eGrnError);

#if GRN_VERSION_OR_LATER(13, 0, 8)
/*
* Document-class: Groonga::BloscError
*
* It is used when Blosc reports an error.
*
* @since 14.1.2
*/
eGrnBloscError =
rb_define_class_under(mGrn, "BloscError", rb_eGrnError);
#endif
}

0 comments on commit 302410b

Please sign in to comment.