"MDL-23407, fixed the problem that firefox trying to download json response"

This commit is contained in:
Dongsheng Cai 2010-07-20 03:21:11 +00:00
parent d44bdfb068
commit ac1870e330

View File

@ -264,9 +264,17 @@ switch ($action) {
}
break;
case 'upload':
// TODO: add file scanning MDL-19380 into each plugin
$result = $repo->upload();
echo json_encode($result);
// handle exception here instead moodle default exception handler
// see MDL-23407
try {
// TODO: add file scanning MDL-19380 into each plugin
$result = $repo->upload();
echo json_encode($result);
} catch (Exception $e) {
$err->error = $e->getMessage();
echo json_encode($err);
die;
}
break;
}