File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -362,7 +362,16 @@ protected function performFindAndUpdateResults(FMBaseBuilder $query){
362362 // find the records in the find request query
363363 $ findQuery = clone $ query ;
364364 $ findQuery ->fieldData = null ;
365- $ results = $ this ->performFind ($ findQuery );
365+ try {
366+ $ results = $ this ->performFind ($ findQuery );
367+ } catch (FileMakerDataApiException $ e ){
368+ if ($ e ->getCode () === 401 ){
369+ // no records match request
370+ // we should exit here
371+ // return 0 to show that no records were updated;
372+ return 0 ;
373+ }
374+ }
366375
367376 $ records = $ results ['response ' ]['data ' ];
368377 $ updatedCount = 0 ;
@@ -375,7 +384,7 @@ protected function performFindAndUpdateResults(FMBaseBuilder $query){
375384 try {
376385 // Do the update
377386 $ this ->editRecord ($ builder );
378- // Upate if we don't get a record missing exception
387+ // Update if we don't get a record missing exception
379388 $ updatedCount ++;
380389 } catch (FileMakerDataApiException $ e ){
381390 // Record is missing is ok for laravel functions
You can’t perform that action at this time.
0 commit comments