File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/Subscription/Controller Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 7
7
use Exception ;
8
8
use OpenApi \Attributes as OA ;
9
9
use PhpList \Core \Domain \Identity \Model \PrivilegeFlag ;
10
+ use PhpList \Core \Domain \Subscription \Exception \CouldNotReadUploadedFileException ;
10
11
use PhpList \Core \Domain \Subscription \Model \Dto \SubscriberImportOptions ;
11
12
use PhpList \Core \Domain \Subscription \Service \SubscriberCsvImporter ;
12
13
use PhpList \Core \Security \Authentication ;
@@ -144,6 +145,10 @@ public function importSubscribers(Request $request): JsonResponse
144
145
'skipped ' => $ stats ['skipped ' ],
145
146
'errors ' => $ stats ['errors ' ]
146
147
]);
148
+ } catch (CouldNotReadUploadedFileException $ exception ) {
149
+ return $ this ->json ([
150
+ 'message ' => 'Could not read uploaded file. ' . $ exception ->getMessage ()
151
+ ], Response::HTTP_BAD_REQUEST );
147
152
} catch (Exception $ e ) {
148
153
return $ this ->json ([
149
154
'message ' => $ e ->getMessage ()
You can’t perform that action at this time.
0 commit comments