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
David Paul
Python3 Automarker
Commits
ef36af9b
Commit
ef36af9b
authored
Nov 01, 2017
by
David Paul
Browse files
Improve error catching to prevent silent errors
parent
4dc87546
Changes
1
Hide whitespace changes
Inline
Side-by-side
grade.php
View file @
ef36af9b
...
...
@@ -86,13 +86,12 @@ $sourcedid = htmlspecialchars($sourcedid);
$operation
=
'replaceResultRequest'
;
$postBody
=
str_replace
(
array
(
'SOURCEDID'
,
'GRADE'
,
'OPERATION'
,
'MESSAGE'
),
array
(
$sourcedid
,
$grade
,
$operation
,
uniqid
()),
array
(
'SOURCEDID'
,
'GRADE'
,
'OPERATION'
,
'MESSAGE'
),
array
(
$sourcedid
,
$grade
,
$operation
,
uniqid
()),
getPOXGradeRequest
());
$response
=
sendOAuthBodyPOST
(
$method
,
$endpoint
,
$oauth_consumer_key
,
$oauth_consumer_secret
,
$content_type
,
$postBody
);
try
{
try
{
$response
=
sendOAuthBodyPOST
(
$method
,
$endpoint
,
$oauth_consumer_key
,
$oauth_consumer_secret
,
$content_type
,
$postBody
);
$retVal
=
parseResponse
(
$response
);
}
catch
(
Exception
$e
)
{
echo
json_encode
(
Array
(
"status"
=>
"failure"
,
"detail"
=>
$e
->
getMessage
(),
"response"
=>
$response
));
...
...
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