1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-08 21:10:05 +00:00

fix(*): handle login required state, fix session creation logic

This commit is contained in:
Krishna Acondy
2020-07-18 15:08:40 +01:00
parent a12244cf78
commit 8bf74d17e9
4 changed files with 47 additions and 33 deletions

View File

@@ -661,7 +661,7 @@ export class SASViyaApiClient {
contextName,
accessToken,
"",
false,
true,
data,
debug
);
@@ -864,12 +864,19 @@ export class SASViyaApiClient {
if (accessToken) {
requestInfo.headers = { Authorization: `Bearer ${accessToken}` };
}
let error;
const rootFolder = await this.request<Folder>(
`${this.serverUrl}${url}`,
requestInfo
).catch(() => null);
).catch((e) => {
error = e;
return null;
});
this.rootFolder = rootFolder?.result || null;
if (error) {
throw new Error(JSON.stringify(error));
}
}
private async pollJobState(