aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-06-24 15:43:59 -0500
committermat <github@matdoes.dev>2021-06-24 15:43:59 -0500
commita6d6be848b1713153f5efcfe163d01e2a16ca77f (patch)
tree7793a7368b5ec97a9292f6287235684027634104 /src
parentfe6fd11b44d57010dfb3bf702bc24fe5a5babb50 (diff)
downloadskyblock-api-a6d6be848b1713153f5efcfe163d01e2a16ca77f.tar.gz
skyblock-api-a6d6be848b1713153f5efcfe163d01e2a16ca77f.tar.bz2
skyblock-api-a6d6be848b1713153f5efcfe163d01e2a16ca77f.zip
why is it broken?????
Diffstat (limited to 'src')
-rw-r--r--src/mojang.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mojang.ts b/src/mojang.ts
index 1d5809f..c5176e6 100644
--- a/src/mojang.ts
+++ b/src/mojang.ts
@@ -40,7 +40,8 @@ export async function profileFromUuid(uuid: string): Promise<MojangApiResponse>
let dataString: string
try {
dataString = await fetchResponse.text()
- } catch {
+ } catch (err) {
+ console.log('failed reading response text', err)
return { uuid: null, username: null }
}
let data
@@ -51,8 +52,7 @@ export async function profileFromUuid(uuid: string): Promise<MojangApiResponse>
// if it errors, just return null
return { uuid: null, username: null }
}
- if (!data.id)
- console.log('mojang response:', data)
+ console.log('mojang response:', data)
return {
uuid: data.id,
username: data.name
@@ -84,10 +84,10 @@ export async function profileFromUsername(username: string): Promise<MojangApiRe
if (!data?.id) {
- console.log('no id returned from mojang', rawData)
// return { uuid: null, username: null }
return await profileFromUsernameAlternative(username)
}
+
return {
uuid: data.id,
username: data.name