diff --git a/lib/Dancer2/Plugin/JsonApi/Registry.pm b/lib/Dancer2/Plugin/JsonApi/Registry.pm index 3eed412..b457d6c 100644 --- a/lib/Dancer2/Plugin/JsonApi/Registry.pm +++ b/lib/Dancer2/Plugin/JsonApi/Registry.pm @@ -45,13 +45,13 @@ sub add_type($self,$type,$definition={}) { =head2 type($type) -Returns the type's C. Throws an +Returns the type's C. Throws an error if the type does not exist. =cut sub type($self,$type) { - return $self->types->{$type} || carp "type '$type' not found\n"; + return $self->types->{$type} || croak "type '$type' not found"; } 1;