Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(1961): Response does not need to be JSON parsed #80

Merged
merged 1 commit into from
Sep 7, 2021
Merged

Conversation

tkyi
Copy link
Member

@tkyi tkyi commented Sep 7, 2021

Context

Getting error with _refreshToken():

api_1    | 210906/113528.737, (1630928128201:e464b22cc7bb:20:kt8k149p:10045) [request,server,error] data: SyntaxError: Unexpected token o in JSON at position 1
api_1    |     at JSON.parse (<anonymous>)
api_1    |     at BitbucketScm._refreshToken (/usr/src/app/node_modules/screwdriver-scm-bitbucket/index.js:1042:27)
api_1    |     at runMicrotasks (<anonymous>)
api_1    |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
api_1    |     at async BitbucketScm._getToken (/usr/src/app/node_modules/screwdriver-scm-bitbucket/index.js:1006:13)
api_1    |     at async BitbucketScm._parseUrl (/usr/src/app/node_modules/screwdriver-scm-bitbucket/index.js:322:23)
api_1    |     at async handler (/usr/src/app/node_modules/screwdriver-api/plugins/pipelines/create.js:32:28)
api_1    |     at async exports.Manager.execute (/usr/src/app/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
api_1    |     at async Object.internals.handler (/usr/src/app/node_modules/@hapi/hapi/lib/handler.js:46:20)
api_1    |     at async exports.execute (/usr/src/app/node_modules/@hapi/hapi/lib/handler.js:31:20)
api_1    |     at async Request._lifecycle (/usr/src/app/node_modules/@hapi/hapi/lib/request.js:372:32)
api_1    |     at async Request._execute (/usr/src/app/node_modules/@hapi/hapi/lib/request.js:280:9)
api_1    | 210906/113528.201, (1630928128201:e464b22cc7bb:20:kt8k149p:10045) [response,api,pipelines] http://localhost:9001: post /v4/pipelines {} 500 (538ms)

Objective

Response for getting token no longer needs to be JSON parsed because the screwdriver-request repo returns responses in JSON format.

References

Related to #79, screwdriver-cd/screwdriver#2553

License

I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@tkyi tkyi merged commit d61b302 into master Sep 7, 2021
@tkyi tkyi deleted the fixToken branch September 7, 2021 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants