HoriSun / closure-compiler

Automatically exported from code.google.com/p/closure-compiler
0 stars 0 forks source link

Get detailed error data on command line #405

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I don't know here I can post it, correctly, then I solve try here.

Well, I need get detailed error data from errors from command line. For 
instance: ! will generate, on CCS:
JSC_PARSE_ERROR: Parse error. Unexpected end of file at line 1 character 1

It's: INTERNAL_ERROR_NAME: Error description at line x character y.

I only can have "Error description" and line number, "workarroundly" I can have 
character number. But never INTERNAL_ERROR_NAME.

It's possible in commmand line?

Bye.

Original issue reported on code.google.com by david7...@gmail.com on 4 Apr 2011 at 10:53

GoogleCodeExporter commented 9 years ago
Sorry, I have no idea what the issue is here.  We can reopen this if you can 
provide a better description.

Original comment by concavel...@gmail.com on 4 Apr 2011 at 8:08

GoogleCodeExporter commented 9 years ago
I'm building a new Closure Compiler IDE webservice opensource. It not depends 
of internet connection and offer more speed (one time that can install local) 
and new features. (see attachment)

The problem is that I need use in command line (java -jar compiler.jar). And 
apparently don't have all features of Closure Compiler (I consulted --help).

I need to get ERROR NAME (like JSC_*) and character position on line (like 
Closure Compile Service).

It's possible? Where I can read more about command line options?

Bye.

Original comment by david7...@gmail.com on 4 Apr 2011 at 8:17

Attachments:

GoogleCodeExporter commented 9 years ago
In the past, we had verbosity flags to make the error message more verbose (or 
less verbose). It might be worthwhile to add something like that for this use 
case?

Original comment by Nicholas.J.Santos on 5 Apr 2011 at 1:38

GoogleCodeExporter commented 9 years ago
Although, honestly, you'd probably be a lot happier if you wrote your own 
version of CommandLineRunner.java that did exactly what you needed and exported 
data in exactly the format you wanted. CommandLineRunner is designed to be 
customizable precisely for use cases like this one.

Original comment by Nicholas.J.Santos on 5 Apr 2011 at 1:41

GoogleCodeExporter commented 9 years ago
Well, I think that Verbose mode is to show all information as possible. Use 
will depends of user. Currently I guess, exists 3 verboses mode: QUIET, 
DEFAULT, VERBOSE.

I think that add a 4th new mode can be useful, printing all verbose data as 
possible, preferentially using JSON-like style, like HIGHVERBOSE or DEBUG.

Example:
  {"type":"JSC_PARSE_ERROR","description":"Parse error. Unexpected end of file","line":1,"character":1}
  {... one error by line}
  1 error(s) and 0 warning(s)

About CommandLineRunner, I'll try it, but I don't a Java fan :/

Well, thanks by support :)

Original comment by david7...@gmail.com on 5 Apr 2011 at 1:48

GoogleCodeExporter commented 9 years ago
I make a noob-patch (for me), but I think that maybe is interesting to show to 
you.

I don't know how to use JSONObject correctly, then I used temporarly manual 
append on StringBuilder.

The generated result is something like:
  {"source":"tmp\885636635$1302336096.8337.tmp",↵
   "line":1,"char":8,↵
   "key":"JSC_PARSE_ERROR",↵
   "type":"ERROR",↵
   "description":"Parse error. missing ; before statement"}
  1 error(s), 0 warning(s)

Note: I put ↵ only to better read, but it don't exists, and not is a \n too.

Original comment by david7...@gmail.com on 9 Apr 2011 at 8:07

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by concavel...@gmail.com on 3 Nov 2011 at 5:10