enhanced error handling for open weather API errors#192
Closed
anveshthakur wants to merge 23 commits intoschachmat:masterfrom
Closed
enhanced error handling for open weather API errors#192anveshthakur wants to merge 23 commits intoschachmat:masterfrom
anveshthakur wants to merge 23 commits intoschachmat:masterfrom
Conversation
Contributor
Author
|
Hi @kordianbruck, Let me know if any changes are required required. Thanks! |
Bug fix for issue schachmat#170 Co-authored-by: Pedro Pereira <pedro.1.pereira@nokia.com>
Current openweather api usage does not have daily astronomy. Api "onecall" seems to have. Co-authored-by: Pedro Pereira <pedro.1.pereira@nokia.com>
compacts the table and hides cloud icons
kordianbruck
requested changes
Oct 6, 2024
Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.13 to 0.1.14. - [Commits](mattn/go-colorable@v0.1.13...v0.1.14) --- updated-dependencies: - dependency-name: github.com/mattn/go-colorable dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Agent-Logs-Url: https://github.com/schachmat/wego/sessions/e7020400-10d3-4119-8c62-9806e4de0ef2 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com>
* Add explicit import aliases for go-runewidth and go-colorable Agent-Logs-Url: https://github.com/schachmat/wego/sessions/0c63b2e2-efeb-44a9-a918-f4e769258361 Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Fix all golangci-lint issues across frontends and backends Agent-Logs-Url: https://github.com/schachmat/wego/sessions/0c63b2e2-efeb-44a9-a918-f4e769258361 Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Update golangci-lint version to v1.64 for Go 1.22+ compatibility Agent-Logs-Url: https://github.com/schachmat/wego/sessions/2043283b-a184-4384-8ee7-6a89926c0b1d Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Update golangci-lint to v2.11.4 to fix Go 1.26 stdlib typecheck error Agent-Logs-Url: https://github.com/schachmat/wego/sessions/de01a58a-38b0-4e37-9ac5-b4518d017a90 Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Upgrade golangci-lint-action to version 7 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> Co-authored-by: Kordian Bruck <kordianbruck@users.noreply.github.com>
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 9. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v6...v9) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-version: '9' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.16 to 0.0.20. - [Commits](mattn/go-runewidth@v0.0.16...v0.0.20) --- updated-dependencies: - dependency-name: github.com/mattn/go-runewidth dependency-version: 0.0.20 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v5...v6) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The endpoints as of 2026-04-04 appear to be: free/v2 => premium/v1 (still free) documented here https://github.com/WorldWeatherOnline/weather-api-docs also, move the debug request print to where it will actually happen on request fail
Co-authored-by: 0x0003 <0x0003@users.noreply.github.com>
* Initial plan * Add man page generation via mango with --man flag Agent-Logs-Url: https://github.com/schachmat/wego/sessions/00705e77-602c-4b73-9fda-139ce74cce3a Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com>
…mat#223) * Initial plan * Implement disk-based JSON caching in /tmp to reduce API calls Agent-Logs-Url: https://github.com/schachmat/wego/sessions/685ebab8-b98c-481c-9089-79312dba6748 Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com>
Collaborator
|
Could you rebase this PR please? |
* Add weatherapi.com backend and update README Agent-Logs-Url: https://github.com/schachmat/wego/sessions/823f57c2-2b5e-4347-962b-f80083b3332d Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Fix API key exposure in error/debug log messages Agent-Logs-Url: https://github.com/schachmat/wego/sessions/823f57c2-2b5e-4347-962b-f80083b3332d Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Fix CodeQL taint: build safe URL without using apiKey Agent-Logs-Url: https://github.com/schachmat/wego/sessions/823f57c2-2b5e-4347-962b-f80083b3332d Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Remove redundant parentheses in address-of expressions Agent-Logs-Url: https://github.com/schachmat/wego/sessions/823f57c2-2b5e-4347-962b-f80083b3332d Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> * Fix lint issues: lowercase error strings and check Body.Close error Agent-Logs-Url: https://github.com/schachmat/wego/sessions/505f0e3a-aa82-4117-b571-e1309ed9dcf8 Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kordianbruck <298860+kordianbruck@users.noreply.github.com>
Contributor
Author
sure. |
Collaborator
|
Something really went wrong in that merge resolve/rebase. |
Contributor
Author
checking. |
Contributor
Author
Hey @kordianbruck, Let me create a fresh PR for this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This change was requested in this issue #176
Description
I've handled error and success case that is coming from open weather API where I am checking the response code from the API and then printing it to the terminal, The marshalling was not happening because API sends Code as a string value for some of cases but if there is an invalid API key they send Code value is coming as an integer value I've handled this and just checking the type and marshalling it to a new struct called
openWeatherErrorResponseSteps for Testing
To test we can check different API responses like -
Screenshots
Invalid API key
Invalid API route
Success