Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ParsePy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ParsePy
Commits
76902066
Commit
76902066
authored
Mar 28, 2016
by
Miles Richardson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return ParseBatchError with list of errors when a batch operation fails
parent
bc0ad58a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
parse_rest/connection.py
+2
-2
parse_rest/core.py
+3
-0
No files found.
parse_rest/connection.py
View file @
76902066
...
@@ -189,10 +189,10 @@ class ParseBatcher(ParseBase):
...
@@ -189,10 +189,10 @@ class ParseBatcher(ParseBase):
if
"success"
in
response
:
if
"success"
in
response
:
callback
(
response
[
"success"
])
callback
(
response
[
"success"
])
else
:
else
:
batched_errors
.
append
(
core
.
ParseError
(
response
[
"error"
])
)
batched_errors
.
append
(
response
[
"error"
]
)
if
batched_errors
:
if
batched_errors
:
raise
batched_errors
[
0
]
raise
core
.
ParseBatchError
(
batched_errors
)
def
batch_save
(
self
,
objects
):
def
batch_save
(
self
,
objects
):
"""save a list of objects in one operation"""
"""save a list of objects in one operation"""
...
...
parse_rest/core.py
View file @
76902066
...
@@ -16,6 +16,9 @@ class ParseError(Exception):
...
@@ -16,6 +16,9 @@ class ParseError(Exception):
'''Base exceptions from requests made to Parse'''
'''Base exceptions from requests made to Parse'''
pass
pass
class
ParseBatchError
(
Exception
):
''' Error in batching operation... should take a list. '''
pass
class
ResourceRequestBadRequest
(
ParseError
):
class
ResourceRequestBadRequest
(
ParseError
):
'''Request returns a 400'''
'''Request returns a 400'''
...
...
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