bzp2010 commented on code in PR #2480: URL: https://github.com/apache/apisix-dashboard/pull/2480#discussion_r905748088
########## web/src/pages/Route/components/DataLoader/Import.tsx: ########## @@ -103,18 +103,20 @@ const DataLoaderImport: React.FC<Props> = (props) => { }); formData.append('file', uploadFileList[0]); - importRoutes(formData).then((r) => { - let errorNumber = 0; - entityNames.forEach((v) => { - errorNumber += r.data[v].failed; - }); + importRoutes(formData) + .then((r) => { + let errorNumber = 0; + entityNames.forEach((v) => { + errorNumber += r.data[v].failed; + }); - setImportResult({ - success: errorNumber <= 0, - data: r.data, - }); - setState('result'); - }); + setImportResult({ + success: errorNumber <= 0, + data: r.data, + }); + setState('result'); + }) + .catch(console.error); Review Comment: We don't actually need to use it to handle errors either, just to prevent JS errors where exceptions are not caught. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org