Skip to content

Package: InvalidMessageException

InvalidMessageException

nameinstructionbranchcomplexitylinemethod
InvalidMessageException(Throwable, Message)
M: 14 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getMsg()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2020, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.translator.exception;
14:
15: import org.eclipse.kapua.message.Message;
16:
17: /**
18: * {@link Exception} to {@code throw} when there is an error while translating a {@link Message}.
19: *
20: * @since 1.2.0
21: */
22: public class InvalidMessageException extends TranslateException {
23:
24: private final Message<?, ?> msg;
25:
26: /**
27: * Constructor.
28: *
29: * @param cause The {@link Throwable} cause of the error.
30: * @param message The {@link Message} which translation has caused the error.
31: * @since 1.2.0
32: */
33: public InvalidMessageException(Throwable cause, Message<?, ?> message) {
34: super(TranslatorErrorCodes.INVALID_MESSAGE, cause, message);
35:
36: this.msg = message;
37: }
38:
39: /**
40: * The {@link Message} which translation has caused the error.
41: *
42: * @return The {@link Message} which translation has caused the error.
43: * @since 1.2.0
44: */
45: public Message<?, ?> getMsg() {
46: return msg;
47: }
48: }