Remove bogus argument, and add error checking code to catch similar errors in future

This commit is contained in:
ian%hixie.ch 2002-12-30 07:52:19 +00:00
Родитель f7331c74e8
Коммит 4504de3dc3
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -125,9 +125,10 @@ sub create {
}
sub init {
my($exception, $method, @data) = @_;
my($exception, @data) = @_;
if (not ref($exception)) {
# in case we were called as a constructor
syntaxError 'odd number of elements passed to exception constructor', 1 if @data % 2;
$exception = $exception->create(@data);
}
# set up the exception and return it