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

Error log prints [object Object] #592

Open
1 task done
Kzoeps opened this issue Oct 15, 2024 · 0 comments
Open
1 task done

Error log prints [object Object] #592

Kzoeps opened this issue Oct 15, 2024 · 0 comments
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised

Comments

@Kzoeps
Copy link

Kzoeps commented Oct 15, 2024

Describe the issue you're facing

While trying to pull components the error log prints out only [object Object].
I mistakenly set my space to 'us' although the actual storyblok space is in eu. This resulted in the api being something like this:

{
  accessToken: '',
  oauthToken: 'some_token_here',
  spaceId: '299747',
  region: '',
  getClient: [Function: getClient],
  getPath: [Function: getPath],
  login: [AsyncFunction: login],
  getUser: [AsyncFunction: getUser],
  persistCredentials: [Function: persistCredentials],
  processLogin: [AsyncFunction: processLogin],
  loginWithToken: [AsyncFunction: loginWithToken],
  logout: [Function: logout],
  signup: [Function: signup],
  isAuthorized: [Function: isAuthorized],
  setSpaceId: [Function: setSpaceId],
  setRegion: [Function: setRegion],
  getPresets: [Function: getPresets],
  getSpaceOptions: [Function: getSpaceOptions],
  getComponents: [Function: getComponents],
  getComponentGroups: [Function: getComponentGroups],
  getDatasources: [Function: getDatasources],
  deleteDatasource: [Function: deleteDatasource],
  post: [Function: post],
  put: [Function: put],
  get: [Function: get],
  getStories: [Function: getStories],
  getSingleStory: [Function: getSingleStory],
  delete: [Function: delete],
  sendRequest: [Function: sendRequest],
  getAllSpacesByRegion: [AsyncFunction: getAllSpacesByRegion],
  apiSwitcher: [Function: apiSwitcher]
}

And so when i tried to pull the components the error printed out by errorHandler was [object Object], since the original error is:

{
  message: 'Not Found',
  status: 404,
  response: 'This record could not be found'
}

Reproduction

https://no-link-idonthave-astorybloklink

Steps to reproduce

  1. create a storyblok
  2. set the space to eu
  3. when logging in through cli set space to 'us'
  4. pull components using: storyblok pull-components --space space_number
  5. error logged is [object Object]

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (12) x64 AMD Ryzen 5 5500U with Radeon Graphics
    Memory: 2.83 GB / 13.47 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 18.17.1 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 9.6.7 - /usr/bin/npm
    pnpm: 9.12.1 - ~/.local/share/pnpm/pnpm
  Browsers:
    Brave Browser: 128.1.69.168
    Chrome: 129.0.6668.100

Used Package Manager

pnpm

Error logs (Optional)

  • Executing pull-components task
    X An error ocurred in pull-components task when load components data
    X An error occurred when executing the pull-components task: [object Object]

Validations

@Kzoeps Kzoeps added pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-author [Issue] Awaiting further information or action from the issue author pending-triage [Issue] Ticket is pending to be prioritised
Projects
None yet
Development

No branches or pull requests

1 participant