eclipse-cdt-cloud / theia-trace-extension

Eclipse Theia trace viewer extension using the Trace Server Protocol (TSP), through the tsp-typescript-client. Also the home for reusable JavaScript libraries: traceviewer-base, traceviewer-react-components
MIT License
49 stars 60 forks source link

Display Invalid Trace message #187

Closed ghost closed 3 years ago

ghost commented 3 years ago

Trace Viewer should show an invalid trace message for all invalid traces.

image

Currently, it's just empty.

ebugden commented 3 years ago

I don't understand the issue description. When a file that is not a recognized trace format is opened as a trace, the Trace Explorer side panel is empty?

Could you add more precision to the issue description and/or add a GIF that shows the issue?

ghost commented 3 years ago

When a file that is not a recognized trace format is opened as a trace, the Trace Explorer side panel is empty?

Yes, this is what I meant. We should display an error message to the user. Attached a gif. I opened an xml file(invalid trace). The user should be shown with an error message. Right now, we do not show anything.

Any thoughts?

Kapture 2020-12-02 at 18 21 43

bhufmann commented 3 years ago

I agree that the there should be a feedback to the user about that.

For an trace type that is unknown by the trace server, it return status 501 (NOT_IMPLEMENTED). I realized when trying it, that there is an uncaught exception created because the tsp-typescript-client can't handle the error case:

Uncaught SyntaxError: Unexpected token T in JSON at position 0
message:'Unexpected token T in JSON at position 0'
stack:'SyntaxError: Unexpected token T in JSON at position 0'

We should at least catch the exception. Looking briefly at the tsp-typescript-client other commands have similar issues when an error code is return.

Maybe in the empty trace editor show a warning message that the trace type (or trace format) is not supported.

ebugden commented 3 years ago

Is it possible for a user to try and open any file type as a trace? I'm wondering if it's worth mentioning in the warning message that the file could not even be a trace file (ex. table.csv, randomtext.txt, executable.bin). Or do typical users know enough about what a trace is that that's an extreme corner case?