diff options
| author | Adam Soltys <[email protected]> | 2022-08-01 10:51:56 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-01 10:51:56 -0700 |
| commit | 9bd23e73014ff6a3ccd1a711e949c257e7ee1361 (patch) | |
| tree | 6424f3efe9bb169894adcefbb970bfa6af868ac9 /src/routes | |
| parent | 89e8e040ed0e11c63a06fba9649b5fdfd1fe9662 (diff) | |
| download | coinos-ui-9bd23e73014ff6a3ccd1a711e949c257e7ee1361.tar.gz coinos-ui-9bd23e73014ff6a3ccd1a711e949c257e7ee1361.zip | |
catch registration errors
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/register.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/routes/register.js b/src/routes/register.js index 9f79f94e..86f12dda 100644 --- a/src/routes/register.js +++ b/src/routes/register.js @@ -1,6 +1,14 @@ import { post } from '$lib/utils'; export async function POST({ request }) { - let user = await request.json(); - return { body: await post('/register', { user }) }; + try { + let user = await request.json(); + let body = await post('/register', { user }); + return { body }; + } catch (e) { + return { + status: 500, + body: e, + }; + } } |
