put duplicate checking into respective modules and out of DXProt.
[spider.git] / perl / DXCommandmode.pm
index 39153ea4b40ae8120c756d83bba9d762a7d8be6f..b76493db31aacb90aab65ff5cc3f3d85f8600843 100644 (file)
@@ -24,9 +24,9 @@ use DXLogPrint;
 use DXBearing;
 use CmdAlias;
 use Filter;
-use Carp;
 use Minimuf;
 use DXDb;
+use AnnTalk;
 use Sun;
 
 use strict;
@@ -246,7 +246,7 @@ sub run_cmd
                                        unless (exists $Cache{$package}->{'sub'}) {
                                                $c = eval $Cache{$package}->{'eval'};
                                                if ($@) {
-                                                       return ("Syserr: Syntax error in $package", $@);
+                                                       return DXDebug::shortmess($@);
                                                }
                                                $Cache{$package}->{'sub'} = $c;
                                        }
@@ -255,7 +255,10 @@ sub run_cmd
                                                @ans = &{$c}($self, $args);
                                    };
                                        
-                                       return ($@) if $@;
+                                       if ($@) {
+                                               cluck($@);
+                                               return (DXDebug::shortmess($@));
+                                       };
                                }
                        } else {
                                dbg('command', "cmd: $cmd not found");