From 2d13f13f8e36c18b81dd51202b92c7419f20000a Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Thu, 9 May 2024 09:54:45 +0100 Subject: [PATCH] Move `BadAsyncResult` at the bottom of exception list Also update wording in `parseResult` --- ocaml/sdk-gen/java/templates/Types.mustache | 27 +++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ocaml/sdk-gen/java/templates/Types.mustache b/ocaml/sdk-gen/java/templates/Types.mustache index 1c06e8b075..636dc60d06 100644 --- a/ocaml/sdk-gen/java/templates/Types.mustache +++ b/ocaml/sdk-gen/java/templates/Types.mustache @@ -174,6 +174,19 @@ public class Types } {{/errors}} + public static class BadAsyncResult extends XenAPIException { + public final String result; + + /** + * Create a new BadAsyncResult + */ + public BadAsyncResult(String result) + { + super(result); + this.result = result; + } + } + {{#types}} /** * Converts an {@link Object} to a {@link {{{name}}}} object. @@ -215,24 +228,12 @@ public class Types {{/generate_reference_task_result_func}} {{/types}} - - public static class BadAsyncResult extends XenAPIException - { - public final String result; - - public BadAsyncResult(String result) - { - super(result); - this.result = result; - } - } - private static String parseResult(String result) throws BadAsyncResult { Pattern pattern = Pattern.compile("(.*)"); Matcher matcher = pattern.matcher(result); if (!matcher.find() || matcher.groupCount() != 1) { - throw new Types.BadAsyncResult("Can't interpret: " + result); + throw new Types.BadAsyncResult("Can't parse: " + result); } return matcher.group(1);