From adc613d8011af7c508050badb1272e8326554c39 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 9 Mar 2020 19:00:14 +0530 Subject: Migrate tunnel related classes to tunnel/ Gradle module Signed-off-by: Harsh Shandilya --- .../java/com/wireguard/config/ParseException.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tunnel/src/main/java/com/wireguard/config/ParseException.java (limited to 'tunnel/src/main/java/com/wireguard/config/ParseException.java') diff --git a/tunnel/src/main/java/com/wireguard/config/ParseException.java b/tunnel/src/main/java/com/wireguard/config/ParseException.java new file mode 100644 index 00000000..c79d1fa1 --- /dev/null +++ b/tunnel/src/main/java/com/wireguard/config/ParseException.java @@ -0,0 +1,44 @@ +/* + * Copyright © 2018-2019 WireGuard LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.wireguard.config; + +import androidx.annotation.Nullable; + +/** + */ +public class ParseException extends Exception { + private final Class parsingClass; + private final CharSequence text; + + public ParseException(final Class parsingClass, final CharSequence text, + @Nullable final String message, @Nullable final Throwable cause) { + super(message, cause); + this.parsingClass = parsingClass; + this.text = text; + } + + public ParseException(final Class parsingClass, final CharSequence text, + @Nullable final String message) { + this(parsingClass, text, message, null); + } + + public ParseException(final Class parsingClass, final CharSequence text, + @Nullable final Throwable cause) { + this(parsingClass, text, null, cause); + } + + public ParseException(final Class parsingClass, final CharSequence text) { + this(parsingClass, text, null, null); + } + + public Class getParsingClass() { + return parsingClass; + } + + public CharSequence getText() { + return text; + } +} -- cgit v1.2.3