File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ public function checkChunk()
69
69
70
70
/**
71
71
* Save chunk
72
- *
73
72
* @return bool
73
+ * @throws \Exception if upload size is invalid or some other unexpected error occurred.
74
74
*/
75
75
public function saveChunk ()
76
76
{
@@ -98,15 +98,11 @@ public function saveChunk()
98
98
99
99
return true ;
100
100
} catch (\Exception $ e ) {
101
- trigger_error ("Could not store chunk: " . $ e ->getMessage () . "\n" . $ e ->getTraceAsString (), E_USER_WARNING );
102
- try {
103
- if (isset ($ chunkQuery )) {
104
- $ this ->config ->getGridFs ()->chunks ->remove ($ chunkQuery );
105
- }
106
- } catch (\Exception $ e2 ) {
107
- // fail gracefully
101
+ // try to remove a possibly (partly) stored chunk:
102
+ if (isset ($ chunkQuery )) {
103
+ $ this ->config ->getGridFs ()->chunks ->remove ($ chunkQuery );
108
104
}
109
- return false ;
105
+ throw $ e ;
110
106
}
111
107
}
112
108
You can’t perform that action at this time.
0 commit comments