mirror of
https://github.com/sasjs/adapter.git
synced 2025-12-11 09:24:35 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aa0ae65e0 | ||
|
|
4b0d62d59b | ||
|
|
b3ef50e9eb |
25
src/SASjs.ts
25
src/SASjs.ts
@@ -12,6 +12,7 @@ import {
|
|||||||
ComputeJobExecutor,
|
ComputeJobExecutor,
|
||||||
JesJobExecutor
|
JesJobExecutor
|
||||||
} from './job-execution'
|
} from './job-execution'
|
||||||
|
import { ErrorResponse } from './types/errors'
|
||||||
|
|
||||||
const defaultConfig: SASjsConfig = {
|
const defaultConfig: SASjsConfig = {
|
||||||
serverUrl: '',
|
serverUrl: '',
|
||||||
@@ -709,9 +710,27 @@ export default class SASjs {
|
|||||||
* @param accessToken - an access token for an authorized user.
|
* @param accessToken - an access token for an authorized user.
|
||||||
*/
|
*/
|
||||||
public async fetchLogFileContent(logUrl: string, accessToken?: string) {
|
public async fetchLogFileContent(logUrl: string, accessToken?: string) {
|
||||||
return await this.requestClient!.get(logUrl, accessToken).then((res) =>
|
return await this.requestClient!.get(logUrl, accessToken).then((res) => {
|
||||||
JSON.stringify(res.result)
|
if (!res)
|
||||||
)
|
return Promise.reject(
|
||||||
|
new ErrorResponse(
|
||||||
|
'Error while fetching log. Response was not provided.'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = JSON.stringify(res.result)
|
||||||
|
|
||||||
|
return result
|
||||||
|
} catch (err) {
|
||||||
|
return Promise.reject(
|
||||||
|
new ErrorResponse(
|
||||||
|
'Error while fetching log. The result is not valid.',
|
||||||
|
err
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public getSasRequests() {
|
public getSasRequests() {
|
||||||
|
|||||||
Reference in New Issue
Block a user