Skip to content

Commit 3dc9b6d

Browse files
committed
fix: debug info
1 parent c0c91e7 commit 3dc9b6d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"axios": "^1.11.0"
1313
},
1414
"name": "scratchattach.ts",
15-
"version": "1.0.6",
15+
"version": "1.0.7",
1616
"description": "Typescript package for accessing https://scratch.mit.edu/",
1717
"author": "faretek1",
1818
"license": "MIT",

src/site/session.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,12 @@ export async function login(username: string, password: string,
184184
}, {
185185
headers: _headers,
186186
timeout: params.timeout,
187+
validateStatus: ((_) => true)
187188
});
188189

190+
if (resp.status !== 200) {
191+
throw new Error(`Login responded with status ${resp.status} with content ${resp.data}`);
192+
}
189193
const sc = resp.headers['set-cookie'];
190194

191195
expect(sc).toBeDefined();

0 commit comments

Comments
 (0)