pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.61k stars 462 forks source link

get error code? #405

Closed kawasakizx10rr closed 4 years ago

kawasakizx10rr commented 4 years ago

Is there any way to get the error code when protoc throws an error message?

I tried using the standard echo %errorlevel% or echo errorlevel and both return 0 even when there was an error such as "is not defined.", "directory does not exist." or "was not found or had errors."

I need to know if the protoc command failed as the batch script is ran on a nightly build server and i need to use "EXIT /B 1" in my script to abort the build and throw an error on the server.

Secondly i see that doc_opt is very fussy on the path supplied, i get all kinds of errors complaining about 'C' is an invalid parameter, even in double quotes and forward slashes used. Forcing me to place the template in the root of the batch file. Though all other switches work fine with a path supplied?

kawasakizx10rr commented 4 years ago

i had to use Setlocal EnableDelayedExpansion and !errorlevel!