From 8c2b581f55a2cb85d8a80de5fcd0e1e9539311b0 Mon Sep 17 00:00:00 2001 From: CesarCoelho Date: Mon, 16 Oct 2023 17:23:43 +0200 Subject: [PATCH] Adds an exception when the MOErrorException --- .../main/java/org/ccsds/moims/mo/mal/MOErrorException.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apis/api-mal/src/main/java/org/ccsds/moims/mo/mal/MOErrorException.java b/apis/api-mal/src/main/java/org/ccsds/moims/mo/mal/MOErrorException.java index 3368e83eb..417fcd65f 100644 --- a/apis/api-mal/src/main/java/org/ccsds/moims/mo/mal/MOErrorException.java +++ b/apis/api-mal/src/main/java/org/ccsds/moims/mo/mal/MOErrorException.java @@ -50,7 +50,11 @@ public MOErrorException(final UInteger errorNumber, final Object extraInformatio super(); if (errorNumber == null) { - throw new IllegalArgumentException("Number argument must not be NULL"); + throw new IllegalArgumentException("The errorNumber argument cannot not be NULL!"); + } + + if (errorNumber.getValue() == 0) { + throw new IllegalArgumentException("The errorNumber argument cannot be zero!"); } this.errorNumber = errorNumber;