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 77use Exception ;
88use OpenApi \Attributes as OA ;
99use PhpList \Core \Domain \Identity \Model \PrivilegeFlag ;
10+ use PhpList \Core \Domain \Subscription \Exception \CouldNotReadUploadedFileException ;
1011use PhpList \Core \Domain \Subscription \Model \Dto \SubscriberImportOptions ;
1112use PhpList \Core \Domain \Subscription \Service \SubscriberCsvImporter ;
1213use PhpList \Core \Security \Authentication ;
@@ -144,6 +145,10 @@ public function importSubscribers(Request $request): JsonResponse
144145 'skipped ' => $ stats ['skipped ' ],
145146 'errors ' => $ stats ['errors ' ]
146147 ]);
148+ } catch (CouldNotReadUploadedFileException $ exception ) {
149+ return $ this ->json ([
150+ 'message ' => 'Could not read uploaded file. ' . $ exception ->getMessage ()
151+ ], Response::HTTP_BAD_REQUEST );
147152 } catch (Exception $ e ) {
148153 return $ this ->json ([
149154 'message ' => $ e ->getMessage ()
You can’t perform that action at this time.
0 commit comments