Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
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
Hardik Juneja
jio-main
Commits
0c387951
Commit
0c387951
authored
Apr 03, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve jIO error handling
parent
f528b71f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
src/jio/core/restCommandRejecter.js
src/jio/core/restCommandRejecter.js
+17
-3
No files found.
src/jio/core/restCommandRejecter.js
View file @
0c387951
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true, regexp: true */
/*global constants, dictUpdate, deepClone */
/*global constants, dictUpdate, deepClone
, DOMException
*/
function
restCommandRejecter
(
param
,
args
)
{
// reject(status, reason, message, {"custom": "value"});
...
...
@@ -72,8 +72,22 @@ function restCommandRejecter(param, args) {
if
((
arg
.
statusText
||
arg
.
status
>=
0
))
{
current_priority
.
status
=
arg
.
statusText
||
arg
.
status
;
}
if
(
arg
instanceof
Error
)
{
current_priority
.
reason
=
arg
.
message
||
""
;
if
(
arg
instanceof
Error
||
arg
instanceof
DOMException
)
{
if
(
arg
.
code
!==
undefined
&&
arg
.
code
!==
null
)
{
current_priority
.
code
=
arg
.
code
;
}
if
(
arg
.
lineNumber
!==
undefined
&&
arg
.
lineNumber
!==
null
)
{
current_priority
.
lineNumber
=
arg
.
lineNumber
;
}
if
(
arg
.
columnNumber
!==
undefined
&&
arg
.
columnNumber
!==
null
)
{
current_priority
.
columnNumber
=
arg
.
columnNumber
;
}
if
(
arg
.
filename
!==
undefined
&&
arg
.
filename
!==
null
)
{
current_priority
.
filename
=
arg
.
filename
;
}
if
(
arg
.
message
!==
undefined
&&
arg
.
message
!==
null
)
{
current_priority
.
reason
=
arg
.
message
;
}
current_priority
.
error
=
arg
.
name
;
}
}
...
...
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