Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Junming
jio
Commits
0fce3ce9
Commit
0fce3ce9
authored
Feb 25, 2014
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5storage.js improve error management
parent
e37bf29c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
29 deletions
+42
-29
src/jio.storage/erp5storage.js
src/jio.storage/erp5storage.js
+42
-29
No files found.
src/jio.storage/erp5storage.js
View file @
0fce3ce9
...
...
@@ -10,7 +10,8 @@
// }
/*jslint indent: 2, nomen: true, unparam: true */
/*global jIO, complex_queries, console, UriTemplate, FormData, RSVP */
/*global jIO, complex_queries, console, UriTemplate, FormData, RSVP,
ProgressEvent */
(
function
(
jIO
,
complex_queries
)
{
"
use strict
"
;
...
...
@@ -62,14 +63,17 @@
.
then
(
function
(
response
)
{
command
.
success
({
"
data
"
:
response
});
})
.
fail
(
function
(
error
)
{
console
.
error
(
error
);
.
fail
(
function
(
event
)
{
console
.
error
(
event
);
if
(
event
instanceof
ProgressEvent
)
{
command
.
error
(
event
.
target
.
status
,
event
.
target
.
statusText
,
"
Cannot find document
"
);
}
// XXX How to propagate the error
command
.
error
(
"
not_found
"
,
"
missing
"
,
"
Cannot find document
"
);
command
.
error
(
event
);
});
};
...
...
@@ -115,13 +119,16 @@
"
Cannot find document
"
);
}
},
function
(
error
)
{
console
.
error
(
error
);
command
.
error
(
500
,
"
Too bad...
"
,
"
Unable to post doc
"
);
},
function
(
event
)
{
console
.
error
(
event
);
if
(
event
instanceof
ProgressEvent
)
{
return
command
.
error
(
event
.
target
.
status
,
event
.
target
.
statusText
,
"
Unable to post doc
"
);
}
command
.
error
(
event
);
});
};
...
...
@@ -158,13 +165,16 @@
.
then
(
function
(
result
)
{
command
.
success
(
result
);
})
.
fail
(
function
(
error
)
{
console
.
error
(
error
);
command
.
error
(
"
error
"
,
"
did not work as expected
"
,
"
Unable to call put
"
);
.
fail
(
function
(
event
)
{
console
.
error
(
event
);
if
(
event
instanceof
ProgressEvent
)
{
return
command
.
error
(
event
.
target
.
status
,
event
.
target
.
statusText
,
"
Unable to call put
"
);
}
command
.
error
(
event
);
});
};
...
...
@@ -223,13 +233,16 @@
count
=
result
.
length
;
command
.
success
({
"
data
"
:
{
"
rows
"
:
result
,
"
total_rows
"
:
count
}});
})
.
fail
(
function
(
error
)
{
console
.
error
(
error
);
command
.
error
(
"
error
"
,
"
did not work as expected
"
,
"
Unable to call allDocs
"
);
.
fail
(
function
(
event
)
{
console
.
error
(
event
);
if
(
event
instanceof
ProgressEvent
)
{
return
command
.
error
(
event
.
target
.
status
,
event
.
target
.
statusText
,
"
Cannot get list of document
"
);
}
command
.
error
(
event
);
});
};
...
...
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