Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alexandra Rogova
jio
Commits
b874d994
Commit
b874d994
authored
Apr 16, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle UnsupportedOptionError
parent
6b4c1794
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
src/jio/core/restCommandRejecter.js
src/jio/core/restCommandRejecter.js
+24
-2
No files found.
src/jio/core/restCommandRejecter.js
View file @
b874d994
...
@@ -5,7 +5,7 @@ function restCommandRejecter(param, args) {
...
@@ -5,7 +5,7 @@ function restCommandRejecter(param, args) {
// reject(status, reason, message, {"custom": "value"});
// reject(status, reason, message, {"custom": "value"});
// reject(status, reason, {..});
// reject(status, reason, {..});
// reject(status, {..});
// reject(status, {..});
var
arg
,
current_priority
,
priority
=
[
var
arg
,
current_priority
,
i
,
l
,
priority
=
[
// 0 - custom parameter values
// 0 - custom parameter values
{},
{},
// 1 - default values
// 1 - default values
...
@@ -72,7 +72,29 @@ function restCommandRejecter(param, args) {
...
@@ -72,7 +72,29 @@ function restCommandRejecter(param, args) {
if
((
arg
.
statusText
||
arg
.
status
>=
0
))
{
if
((
arg
.
statusText
||
arg
.
status
>=
0
))
{
current_priority
.
status
=
arg
.
statusText
||
arg
.
status
;
current_priority
.
status
=
arg
.
statusText
||
arg
.
status
;
}
}
if
(
arg
instanceof
Error
||
arg
instanceof
DOMException
)
{
if
(
arg
.
error
===
"
UnsupportedOptionError
"
&&
Array
.
isArray
(
arg
[
"
arguments
"
]))
{
l
=
arg
[
"
arguments
"
].
length
;
if
((
typeof
arg
.
message
!==
"
string
"
||
arg
.
message
===
""
)
&&
l
>
0
)
{
current_priority
.
message
=
"
Option
"
;
if
(
0
<
l
)
{
current_priority
.
message
+=
"
`
"
+
arg
[
"
arguments
"
][
0
]
+
"
`
"
;
}
i
=
1
;
while
(
i
<
l
-
1
)
{
current_priority
.
message
+=
"
, `
"
+
arg
[
"
arguments
"
][
i
]
+
"
`
"
;
i
+=
1
;
}
if
(
i
<
l
)
{
current_priority
.
message
+=
"
and `
"
+
arg
[
"
arguments
"
][
i
]
+
"
` are not supported.
"
;
}
else
{
current_priority
.
message
+=
"
is not supported.
"
;
}
current_priority
[
"
arguments
"
]
=
arg
[
"
arguments
"
];
}
}
else
if
(
arg
instanceof
Error
||
arg
instanceof
DOMException
)
{
if
(
arg
.
code
!==
undefined
&&
arg
.
code
!==
null
)
{
if
(
arg
.
code
!==
undefined
&&
arg
.
code
!==
null
)
{
current_priority
.
code
=
arg
.
code
;
current_priority
.
code
=
arg
.
code
;
}
}
...
...
Write
Preview
Markdown
is supported
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