2018-11-07 12:24:35 -08:00
|
|
|
// Copyright 2013 The Flutter Authors. All rights reserved.
|
2017-03-17 09:04:59 +01:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
package io.flutter.plugin.common;
|
|
|
|
|
|
2019-05-08 01:19:24 -07:00
|
|
|
import android.util.Log;
|
|
|
|
|
|
2019-05-02 17:30:19 -07:00
|
|
|
import io.flutter.BuildConfig;
|
|
|
|
|
|
2017-03-17 09:04:59 +01:00
|
|
|
/**
|
|
|
|
|
* Thrown to indicate that a Flutter method invocation failed on the Flutter side.
|
|
|
|
|
*/
|
|
|
|
|
public class FlutterException extends RuntimeException {
|
2019-05-08 01:19:24 -07:00
|
|
|
private static final String TAG = "FlutterException#";
|
|
|
|
|
|
2017-03-17 09:04:59 +01:00
|
|
|
public final String code;
|
|
|
|
|
public final Object details;
|
2018-11-07 12:24:35 -08:00
|
|
|
|
2017-03-17 09:04:59 +01:00
|
|
|
FlutterException(String code, String message, Object details) {
|
|
|
|
|
super(message);
|
2019-05-02 17:30:19 -07:00
|
|
|
if (BuildConfig.DEBUG && code == null) {
|
2019-05-08 01:19:24 -07:00
|
|
|
Log.e(TAG, "Parameter code must not be null.");
|
2019-05-02 17:30:19 -07:00
|
|
|
}
|
2017-03-17 09:04:59 +01:00
|
|
|
this.code = code;
|
|
|
|
|
this.details = details;
|
|
|
|
|
}
|
|
|
|
|
}
|