From: Tilman Sauerbeck Date: Sun, 12 Feb 2006 15:42:28 +0000 (+0000) Subject: Raise errors in EventHandler#initialize rather than returning nil. X-Git-Url: http://git.code-monkey.de/?p=ruby-ecore.git;a=commitdiff_plain;h=fecda12a49e445f7de3c6e6452c65b96cd6861e5 Raise errors in EventHandler#initialize rather than returning nil. --- diff --git a/src/ecore/rb_event_handler.c b/src/ecore/rb_event_handler.c index 81a5fdc..12e2739 100644 --- a/src/ecore/rb_event_handler.c +++ b/src/ecore/rb_event_handler.c @@ -1,5 +1,5 @@ /* - * $Id: rb_event_handler.c 357 2006-02-12 15:40:30Z tilman $ + * $Id: rb_event_handler.c 358 2006-02-12 15:42:28Z tilman $ * * Copyright (C) 2004 ruby-ecore team (see AUTHORS) * @@ -83,14 +83,14 @@ static VALUE c_init (VALUE self, VALUE type) int t; if (!rb_block_given_p ()) - return Qnil; + rb_raise (rb_eStandardError, "block missing"); Data_Get_Struct (self, RbEventHandler, h); t = NUM2INT (type); if (t <= ECORE_EVENT_NONE) - return Qnil; + rb_raise (rb_eStandardError, "invalid type"); rb_iv_set (self, "@type", type);