Revision ebbd769a
Von Sven Schöling vor fast 3 Jahren hinzugefügt
SL/DB/DeliveryOrder/TypeData.pm | ||
---|---|---|
154 | 154 |
sub validate_type { |
155 | 155 |
my ($type) = @_; |
156 | 156 |
|
157 |
return $valid_types{$type} // confess "invalid type '$type'";
|
|
157 |
return $valid_types{$type} // croak "invalid type '$type'";
|
|
158 | 158 |
} |
159 | 159 |
|
160 | 160 |
sub get { |
161 | 161 |
my ($type, $key) = @_; |
162 | 162 |
|
163 |
croak "invalid type '$type'" unless exists $type_data{$type}; |
|
164 |
|
|
163 | 165 |
my $ret = $type_data{$type}->{$key} // die "unknown property '$key'"; |
164 | 166 |
|
165 | 167 |
ref $ret eq 'CODE' |
... | ... | |
170 | 172 |
sub get3 { |
171 | 173 |
my ($type, $topic, $key) = @_; |
172 | 174 |
|
173 |
my $ret = $type_data{$type}{$topic}{$key} // die "unknown property '$key' in topic '$topic' for type '$type'"; |
|
175 |
croak "invalid type '$type'" unless exists $type_data{$type}; |
|
176 |
|
|
177 |
my $ret = $type_data{$type}{$topic}{$key} // croak "unknown property '$key' in topic '$topic' for type '$type'"; |
|
174 | 178 |
|
175 | 179 |
ref $ret eq 'CODE' |
176 | 180 |
? $ret->() |
Auch abrufbar als: Unified diff
Lieferschein TypeData: croak wenn typ nicht existiert