> +
> + Console.Type type = (Console.Type) postParams.get("type");
> +
> + switch (type) {
> + case NOVNC:
> + case XVPVNC:
> + action = "os-getVNCConsole";
> + break;
> + case SPICE_HTML5:
> + action = "os-getSPICEConsole";
> + break;
> + case RDP_HTML5:
> + action = "os-getRDPConsole";
> + break;
> + default:
> + throw new IllegalArgumentException("Invalid type: " + type);
It is not a valid input to `getConsole()`, and this is why I put the `throw` in
this place. If you think the fromValue() in Console.Type enum is a better place
to throw this exception I'll change this. In my opinion however the binder is a
more appropriate place to validate the arguments and throw an exception, than
the fromValue() in the enums.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/339/files#r13062737