1 // Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file 2 // for details. All rights reserved. Use of this source code is governed by a 3 // BSD-style license that can be found in the LICENSE file. 4 package com.android.tools.r8; 5 6 /** 7 * Exception to signal an compilation error. 8 * 9 * This is always an expected error and considered a user input issue. 10 * A user-understandable message must be provided. 11 */ 12 public class CompilationException extends Exception { 13 private static final long serialVersionUID = 1L; 14 15 /** 16 * Construct the exception with a {@link String} message. 17 * @param message the message 18 */ CompilationException(String message)19 public CompilationException(String message) { 20 super(message); 21 } 22 23 /** 24 * Construct the exception with a {@link String} message and a {@link Throwable} cause. 25 * @param message the message 26 * @param cause the cause 27 */ CompilationException(String message, Throwable cause)28 public CompilationException(String message, Throwable cause) { 29 super(message, cause); 30 } 31 32 /** 33 * Construct the exception with a {@link Throwable} cause. 34 * @param cause the cause 35 */ CompilationException(Throwable cause)36 public CompilationException(Throwable cause) { 37 super(cause.getMessage(), cause); 38 } 39 } 40 41