sub allocate {
   my (%params) = @_;
 
-  my $part = $params{part} or Carp::croak('allocate needs a part');
-  my $qty  = $params{qty}  or Carp::croak('allocate needs a qty');
+  die SL::X::Inventory::Allocation->new(
+    error => 'allocate needs a part',
+    msg => t8("Method allocate needs the parameter 'part'"),
+  ) unless $params{part};
+  die SL::X::Inventory::Allocation->new(
+    error => 'allocate needs a qty',
+    msg => t8("Method allocate needs the parameter 'qty'"),
+  ) unless $params{qty};
+
+  my $part = $params{part};
+  my $qty  = $params{qty};
 
   return () if $qty <= 0;
 
 
   'Meta tag keywords'           => 'Metatag Keywords',
   'Meta tag title'              => 'Metatag Titel',
   'Method'                      => 'Verfahren',
+  'Method allocate needs the parameter \'part\'' => 'Es fehlt der Parameter \'part\'',
+  'Method allocate needs the parameter \'qty\'' => 'Es fehlt der Parameter \'qty\' oder die Menge ist 0',
   'Microfiche'                  => 'Mikrofilm',
   'Minimum Amount'              => 'Mindestbetrag',
   'Miscellaneous'               => 'Verschiedenes',