Skip to content

Commit

Permalink
Add error handling for bad response codes from sync
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnStarich committed Mar 11, 2020
1 parent 2b8c691 commit 0b479a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/src/Sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async function getStatus() {
return (await API.get('/v1/getLedgerSyncStatus')).data
} catch (e) {
console.error(e)
return
return {Syncing: false, Error: e.message}
}
}

Expand Down Expand Up @@ -46,6 +46,10 @@ export default function Sync({ className, onSync }) {
setSyncing(true)
setError(null)
API.post('/v1/syncLedger')
.catch(e => {
setSyncing(false)
setError(e.message)
})
}

let classNames = ["sync"]
Expand Down

0 comments on commit 0b479a7

Please sign in to comment.