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

Not handling responses with errors: null #951

Open
stukennedy opened this issue Jun 30, 2024 · 0 comments
Open

Not handling responses with errors: null #951

stukennedy opened this issue Jun 30, 2024 · 0 comments

Comments

@stukennedy
Copy link

Any response with errors = null causes the library to throw an error

e.g. this response:

{
	"data": {
		"viewer": {
			"accounts": [
				{
					"r2OperationsAdaptiveGroups": [
						{
							"dimensions": {
								"actionType": "GetObject"
							},
							"sum": {
								"responseBytes": 87658765
							}
						}
					]
				}
			]
		}
	},
	"errors": null
}

throws
Error: Invalid execution result: errors is not plain object OR array

The library should be able to handle null errors i.e. the success state.
This is a Cloudflare API I'm calling, so obviously can't change the responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants