1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.xwalk.app.runtime;
8 * This class is to consolidate the exceptions happen when
9 * the runtime client is trying to invoke runtime library
12 * The exception will be set different label to identify which
13 * stage the exception happened in.
15 * The exception handler for the runtime client will take
16 * different action based on the type of the exception.
18 public class XWalkRuntimeLibraryException extends Exception {
19 public final static int XWALK_RUNTIME_LIBRARY_NOT_INSTALLED = 1;
20 public final static int XWALK_RUNTIME_LIBRARY_NOT_UP_TO_DATE_CRITICAL = 2;
21 public final static int XWALK_RUNTIME_LIBRARY_NOT_UP_TO_DATE_WARNING = 3;
22 public final static int XWALK_RUNTIME_LIBRARY_INVOKE_FAILED = 4;
25 private Exception mOriginException;
27 XWalkRuntimeLibraryException(int type, Exception originException) {
29 mOriginException = originException;
32 XWalkRuntimeLibraryException(int type) {
34 mOriginException = null;
37 XWalkRuntimeLibraryException() {
38 mType = XWALK_RUNTIME_LIBRARY_NOT_INSTALLED;
39 mOriginException = null;
42 public int getType() {
46 public Exception getOriginException() {
47 return mOriginException;