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_CORE_LIBRARY_SO_NOT_EXIST = 4;
23 public final static int XWALK_RUNTIME_LIBRARY_INVOKE_FAILED = 5;
26 private Exception mOriginException;
28 XWalkRuntimeLibraryException(int type, Exception originException) {
30 mOriginException = originException;
33 XWalkRuntimeLibraryException(int type) {
35 mOriginException = null;
38 XWalkRuntimeLibraryException() {
39 mType = XWALK_RUNTIME_LIBRARY_NOT_INSTALLED;
40 mOriginException = null;
43 public int getType() {
47 public Exception getOriginException() {
48 return mOriginException;