Introduce HasJavascriptExceptionMetadata interface

Summary:
@public

Introduces `HasJavascriptExceptionMetadata`, a thin interface to be implemented by all RN (Android) exception classes that represent JavaScript errors (primarily `JavascriptException` and any subclasses).

Also adds a builder-style API for setting the `extraDataAsJson` field on `JavascriptException` instances.

Reviewed By: abhinavbatra

Differential Revision: D16090574

fbshipit-source-id: 427a0d371f1cb4e6fe2e62a91db7857a191fdb8c
This commit is contained in:
Moti Zilberman
2019-07-16 09:30:52 -07:00
committed by Facebook Github Bot
parent f7695e0183
commit 6fb1690de1
2 changed files with 31 additions and 1 deletions
@@ -0,0 +1,16 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.facebook.react.common;
import javax.annotation.Nullable;
/** A JS exception carrying metadata. */
public interface HasJavascriptExceptionMetadata {
@Nullable
String getExtraDataAsJson();
}