mike-jumper commented on a change in pull request #500: URL: https://github.com/apache/guacamole-client/pull/500#discussion_r637511477
########## File path: guacamole-common/src/main/java/org/apache/guacamole/GuacamoleServerErrorCommandException.java ########## @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.guacamole; + +import org.apache.guacamole.protocol.GuacamoleStatus; + +/** + * The exception thrown when the Guacamole server explicitly sends an error + * command to the client. The error message and status code reflect the arguments + * of the error command as determined by the server. + */ +public class GuacamoleServerErrorCommandException extends GuacamoleServerException { Review comment: What about adding a static utility method like `fromStatus()` to `GuacamoleServerException`? For example: ```java public static GuacamoleServerException fromStatus(GuacamoleStatus status, String message) { ... } ``` As we already provide an exception for each status code, code attempting to connect using `ConfiguredGuacamoleSocket` would be able to handle specific error conditions by catching the appropriate exceptions, rather than catching a new type of exception and inspecting the status. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
