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

Improve Hetzner API error catching #70

Closed
raphaelbernhart opened this issue Jan 3, 2024 · 0 comments
Closed

Improve Hetzner API error catching #70

raphaelbernhart opened this issue Jan 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@raphaelbernhart
Copy link
Owner

raphaelbernhart commented Jan 3, 2024

The error catching of the hcloud sdk is not helpful while debugging.

Possible improvement:
log out:

  • Status code
  • status message
  • path
  • method
  • env token key (⚠️ KEY ONLY)

Error log:

> healthznerbot@2.0.4 start /app
> node .

◐ Start registering 3 commands(/).
✔ Successfully registered 3 commands(/).
◐ Logging in the bot
ℹ Registering Status command worker
✔ Finished registering of Status command worker
✔ Logged in as Healthznerbot
            [Symbol(triggerId)]: 111335
          },
          [Symbol(kBuffer)]: null,
          [Symbol(kBufferCb)]: null,
          [Symbol(kBufferGen)]: null,
          [Symbol(kCapture)]: false,
          [Symbol(kSetNoDelay)]: false,
          [Symbol(kSetKeepAlive)]: false,
          [Symbol(kSetKeepAliveInitialDelay)]: 0,
          [Symbol(kBytesRead)]: 0,
          [Symbol(kBytesWritten)]: 232,
          [Symbol(connect-options)]: {
            rejectUnauthorized: true,
            checkServerIdentity: [Function: checkServerIdentity],
            minDHSize: 1024,
            session: [Buffer [Uint8Array]],
            maxRedirects: 21,
            maxBodyLength: 10485760,
            protocol: 'https:',
            path: null,
            method: 'GET',
            headers: [Object],
            agent: undefined,
            agents: [Object],
            auth: undefined,
            hostname: 'api.hetzner.cloud',
            port: 443,
            nativeProtocols: [Object],
            pathname: '/v1/servers',
            _defaultAgent: [Agent],
            host: 'api.hetzner.cloud',
            noDelay: true,
            servername: 'api.hetzner.cloud',
            _agentKey: 'api.hetzner.cloud:443:::::::::::::::::::::',
            encoding: null,
            singleUse: true
          }
        },
        incoming: null,
        outgoing: [Circular *2],
        maxHeaderPairs: 2000,
        _consumed: false,
        onIncoming: [Function: parserOnIncomingClient],
        joinDuplicateHeaders: undefined,
        [Symbol(resource_symbol)]: HTTPClientAsyncResource {
          type: 'HTTPINCOMINGMESSAGE',
          req: [Circular *2]
        }
      },
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'api.hetzner.cloud',
      protocol: 'https:',
      _redirectable: [Circular *4],
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype] {
        accept: [ 'Accept', 'application/json, text/plain, */*' ],
        'user-agent': [ 'User-Agent', 'hcloud-js/1.4.1' ],
        authorization: [
        ],
        host: [ 'Host', 'api.hetzner.cloud' ]
      },
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 16384,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null,
      [Symbol(kError)]: undefined
    },
    _currentUrl: 'https://api.hetzner.cloud/v1/servers',
    _timeout: null,
    [Symbol(kCapture)]: false
  },
  response: undefined,
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant