tooltitude / support

Tooltitude Support
https://www.tooltitude.com
Other
21 stars 0 forks source link

Cannot ignore the error message #10

Open faceair opened 1 year ago

faceair commented 1 year ago

Tooltitude Version: v0.14.0

OS Version: macOS 13.3.1

VS Code Version: 1.77.3

Go Version: 1.20.3

Code Repository (if open source): no

What did you try to do?

This is a very common way of writing. I don't want to handle this error, how should I ignore it? When I click on "Exclude", there is an error message in the bottom right corner.

image

Is there anything interesting in the tooltitude output channel? (should be open if you are reporting error from within VS Code) no

Steps to reproduce

fmt.Fprintf(w, `{"status":"ok"}`)
tooltitude-support commented 1 year ago

You should ignore this error. It's an info error, i.e. not an error at all, just a hint to show a user that there's an code action available. The problem here is the extension which shows it as an unhandled error.

BTW, what extension do you use for the Unhandled error hint? What is the Exclude/Rule Definition popup? Is it the same or separate extension?

tooltitude-support commented 1 year ago

Double checked, it's not even an info. It's a hint.

tooltitude-support commented 1 year ago

Concerning the resolution for this. I could ignore the fmt. writing to a string or to stdout/stderr, but here you write to a writer, which could fail, i.e. in this case it's potentially problematic code, i.e. in theory it could really fail.

faceair commented 1 year ago

I'm sorry, I thought that popup was from Tooltitude, but it's actually from Error Lens.

I will adjust the configuration of my Error Lens to remove the hints.

"errorLens.enabledDiagnosticLevels": [
   "info",
   "hint",
   "warning"
]

What you said is correct. This writer may indeed fail to write. But you know, in an HTTP request, it's not very important if the response writer can't write to it.

tooltitude-support commented 1 year ago

@faceair I think, we need to find a way which is more compatible with the errorLens. I.e. may be there's no real need to put a hint there, or at least put hint only on the most obvious problems. So I will keep this issue open.