Thread Fehlerbehandlung (13 answers)
Opened by Schland-Meister at 2012-06-25 14:17

Gast Schland-Meister
 2012-06-25 14:17
#159357 #159357
Ich tut mich schwer diesen Fehler zu behandeln:

Code (perl): (dl )
1
2
3
4
5
#!/usr/bin/perl
use diagnostics;
use URI;
my $uri = URI->new("-invalid-input-harhar-")->canonical;
my $host = $uri->host;


Fehlermeldung:
Code: (dl )
1
2
3
4
5
6
7
8
9
Can't locate object method "host" via package "URI::_generic" at /tmp/foo.pl
line 5 (#1)
(F) You called a method correctly, and it correctly indicated a package
functioning as a class, but that package doesn't define that particular
method, nor does any of its base classes. See perlobj.

Uncaught exception from user code:
Can't locate object method "host" via package "URI::_generic" at /tmp/foo.pl line 5.
at /tmp/foo.pl line 5


Wie müsste dieser Fehlerfall abgefangen werden. Gibt es ein "perlerrtut" im Netz?

-
Schland-Meister
Last edited: 2012-06-25 14:26:13 +0200 (CEST)

View full thread Fehlerbehandlung