Skip to content

Package: InvalidChannelException

InvalidChannelException

nameinstructionbranchcomplexitylinemethod
InvalidChannelException(Throwable, Channel)
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%
getChannel()
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.Channel;
16:
17: /**
18: * {@link Exception} to {@code throw} when there is an error while translating a {@link Channel}.
19: *
20: * @since 1.2.0
21: */
22: public class InvalidChannelException extends TranslateException {
23:
24: private final Channel channel;
25:
26: /**
27: * Constructor.
28: *
29: * @param cause The {@link Throwable} cause of the error.
30: * @param channel The {@link Channel} which translation has caused the error.
31: * @since 1.2.0
32: */
33: public InvalidChannelException(Throwable cause, Channel channel) {
34: super(TranslatorErrorCodes.INVALID_CHANNEL, cause, channel);
35:
36: this.channel = channel;
37: }
38:
39: /**
40: * The {@link Channel} which translation has caused the error.
41: *
42: * @return The {@link Channel} which translation has caused the error.
43: * @since 1.2.0
44: */
45: public Channel getChannel() {
46: return channel;
47: }
48: }