Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robert Spencer
wiaflos
Commits
d8d42907
Commit
d8d42907
authored
Nov 28, 2016
by
Nigel Kukard
Browse files
Better error handling
parent
66fb719b
Changes
1
Hide whitespace changes
Inline
Side-by-side
wiaflos/client/cmdline.pm
View file @
d8d42907
...
...
@@ -165,7 +165,7 @@ sub ui_start
# For everything else try open the file
}
else
{
# Exit with code given by the loadFile function
if
(
loadFile
(
\
*STDERR
,"
file='
$file
'
")
<
0
)
{
if
(
loadFile
(
$OUT
,"
file='
$file
'
")
<
0
)
{
exit
1
;
}
}
...
...
@@ -244,7 +244,7 @@ sub loadFile
# Process
if
((
my
$res
=
processCommand
(
$OUT
,
$cmdline
))
<
0
)
{
print
(
$OUT
"
=> Failed to execute command:
$cmdline
\n
");
print
(
$OUT
"
=> Failed to execute command
on line
$line_current
:
$cmdline
\n
");
return
$res
;
}
}
...
...
@@ -494,13 +494,13 @@ sub processCommand
}
elsif
(
$res
>
0
)
{
# print($OUT " => Ok! (res: $res)\n");
}
elsif
(
$res
==
-
103
)
{
print
(
$OUT
"
=> ERROR - Not authorized to access this function
\n
");
print
(
$OUT
"
=> ERROR - Not authorized to access this function
:
$cmdline
\n
");
}
elsif
(
$res
==
-
200
)
{
print
(
$OUT
"
=> ERROR - Invalid command
\n
");
print
(
$OUT
"
=> ERROR - Invalid command
:
$cmdline
\n
");
}
elsif
(
$res
==
-
201
)
{
print
(
$OUT
"
=> ERROR - Command not valid in this state
\n
");
print
(
$OUT
"
=> ERROR - Command not valid in this state
:
$cmdline
\n
");
}
elsif
(
$res
==
-
202
)
{
print
(
$OUT
"
Usage
E
rror
...
\n
");
print
(
$OUT
"
=> ERROR -
Usage
e
rror
:
$cmdline
\n
");
print
(
$OUT
"
"
.
$matchedCmd
->
{'
Help
'}
.
"
\n
");
}
else
{
print
(
$OUT
"
=> ERROR - Processing line:
$cmdline
\n
");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment