Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

params parse error #160

Closed
auyang-0626 opened this issue Aug 9, 2019 · 4 comments
Closed

params parse error #160

auyang-0626 opened this issue Aug 9, 2019 · 4 comments
Labels
chaosblade-exec-jvm chaosblade-exec-jvm project type/bug Something isn't working
Milestone

Comments

@auyang-0626
Copy link

bug report : params parse error

Describe what happened (or what feature you want)

When I execute the following command,--exception no assignment,In theory, it should report an error, but the execution is successful.

./blade create servlet throwCustomException --exception  --servletpath /app/list.json
### Describe what you expected to happen

And then, all requests will be given an error.
image

I think it is a parameter parsing error.This is very dangerous in the production environment.
image

@bryanYao
Copy link

bryanYao commented Aug 9, 2019

--exception string Exception class inherit java.lang.Exception (required)

you should give the exception name you expented, like Exception,
so you can change your command like this:
./blade create servlet throwCustomException --exception Exception --servletpath /app/list.json

@auyang-0626
Copy link
Author

I mean --exception is followed by no arguments and can be created successfully.
But it will match all HTTP requests and will throw an exception (the specified exception class could not be found and then throw a runtimeException).
However, I just want to make an interface throw an exception, without parameters, should tell me that the command created is not legal.

我的意思是--exception后面不加参数,也可以创建成功。但是它会匹配到所有的HTTP请求,并且都会抛出异常(找不到指定的异常类,然后抛出了runtimeException)。
但是,我只是想让某个接口抛异常,没加参数,应该告诉我创建的命令不合法。

@xcaspar
Copy link
Member

xcaspar commented Aug 28, 2019

@auyang-0626 I understand what you mean. It's a bug. It should return error message for the error parameters. We will fix it in next version.

@xcaspar xcaspar added this to the 0.3.0 milestone Aug 28, 2019
@xcaspar
Copy link
Member

xcaspar commented Sep 10, 2019

Add exception value check. See chaosblade-io/chaosblade-exec-jvm@217f817 for the detail.

It returns {"code":405,"success":false,"error":"illegal exception value"} under the case.

@xcaspar xcaspar closed this as completed Sep 10, 2019
@xcaspar xcaspar added type/bug Something isn't working chaosblade-exec-jvm chaosblade-exec-jvm project labels Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chaosblade-exec-jvm chaosblade-exec-jvm project type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants