cloudflare / cloudflare/cloudflare-go
Errors not returned in url scanning response
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 781
- Avg merge
- 12h 38m
- Merged PRs (30d)
- 4
Description
### Confirm this is a Go library issue and not an underlying Cloudflare API issue
- [x] This is an issue with the Go library
### Describe the bug
There is an `errors` node available via api that is not exposed to the sdk. The use case for us here is to scan domains and import certain metadata from these domains.
the problem here is we currently check `if task.success`, snooze and retry job later. this can lead to an infinite check for this domain when not needed. there is also a `status` field that can be checked `status == finished`.
but it is also important for us to be able to surface the `errors` to the user, it is also not available in the JSON field raw `JSON` field. and also for us to log the errors to provide insights to why certain things fail
Workaround is to make a direct api call without the sdk
### To Reproduce
1. create a url scan with a non existent domain e.g ( fhfjfkff.com e.g )
2. fetch the results via api ( I see the `errors` node )
3. fetch the result via the sdk errors node not available via sdk https://github.com/cloudflare/cloudflare-go/blob/a5aab06b7fa01b0472bfbb381bdb2f5a47b88392/url_scanner/scan.go#L5261
### Code snippets
```Go
```
### OS
macOS
### Go version
1.26
### Library version
v7.3.0
Contributor guide
Assessment
This issue has not been assessed yet.