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

Don't let adapter terminate itself for 50x API-errors #7

Open
MiGoller opened this issue Feb 28, 2022 · 1 comment
Open

Don't let adapter terminate itself for 50x API-errors #7

MiGoller opened this issue Feb 28, 2022 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@MiGoller
Copy link
Owner

Keep on the adapter retrying to connect to the Xplora API while ignoring 50x errors like "502 - bad gateway".

@MiGoller MiGoller added bug Something isn't working enhancement New feature or request labels Feb 28, 2022
@MiGoller MiGoller self-assigned this Feb 28, 2022
@MiGoller
Copy link
Owner Author

The GraphQL response looks like this.

{
    "response": {
        "error":"\r\n\r\n\r\n
502 Bad Gateway
\r\n
nginx/1.14.0 (Ubuntu)
\r\n\r\n\r\n",
        "status":502,
        "headers":{}},
        "request":{"query":" ... ",
        "variables":{ ... }
    }
}

Just check for status-code 502 to ignore the response and retry after some seconds.

@MiGoller MiGoller mentioned this issue Jul 1, 2022
MiGoller added a commit that referenced this issue Jul 1, 2022
- Updated default value for datapoint `info.lastUpdate` to fix issue [#9 Object xplora.0.info.lastUpdate is invalid](#9)

- Catch uncaught exceptions for invalid or missing XPLORA data returned from API to fix issue [#7 Don't let adapter terminate itself for 50x API-errors](#7)
MiGoller added a commit that referenced this issue Jul 1, 2022
- Updated default value for datapoint `info.lastUpdate` to fix issue [#9 Object xplora.0.info.lastUpdate is invalid](#9)

- Catch uncaught exceptions for invalid or missing XPLORA data returned from API to fix issue [#7 Don't let adapter terminate itself for 50x API-errors](#7)
MiGoller added a commit that referenced this issue Jul 1, 2022
- Updated default value for datapoint `info.lastUpdate` to fix issue [#9 Object xplora.0.info.lastUpdate is invalid](#9)

- Catch uncaught exceptions for invalid or missing XPLORA data returned from API to fix issue [#7 Don't let adapter terminate itself for 50x API-errors](#7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant