browsix icon indicating copy to clipboard operation
browsix copied to clipboard

Surprising behavior for commands in Unix shell

Open emeryberger opened this issue 9 years ago • 6 comments

$ ls -ltra
/usr/bin/ls: [object Object]$ 

emeryberger avatar Feb 19 '16 23:02 emeryberger

A couple of issues here.

  • [x] error is being stringified, rather than accessing error.message
  • [x] no newline on end of error message
  • [x] in fact, we shouldn't be hitting a fs error, because we should be parsing -ltra as 4 1-char arguments.
  • [ ] All commands should provide a -h option to get a list of valid options.

I've fixed the first 3 issues in 81a04c692 for ls, but this needs to be updated & standardized for all the commands.

bpowers avatar Feb 22 '16 17:02 bpowers

Going to leave this open as a tracking issue until all commands are fixed.

bpowers avatar Feb 22 '16 17:02 bpowers

Do the error objects not have a toString()? (And whose error objects are they?)

jvilk avatar Feb 22 '16 17:02 jvilk

(BrowserFS error objects have toString() defined to return error.message)

jvilk avatar Feb 22 '16 17:02 jvilk

@jvilk they start as BrowserFS errors, but when they are transferred to the Worker the prototype is stripped thanks to the structured cloning algorithm :\

Right before postMessage to worker: screenshot from 2016-02-22 13-21-27

After worker gets the message: screenshot from 2016-02-22 13-16-38

bpowers avatar Feb 22 '16 18:02 bpowers

I guess I should detect if we've received something like an ApiError and replace the received object with a new ApiError

bpowers avatar Feb 22 '16 18:02 bpowers