modules/ballerina-native/src/main/java/org/ballerinalang/nativeimpl/lang/utils/ErrorHandler.java
public static void handleMalformedJson(String operation, Exception e) {
        // here local message of the cause is logged whenever possible, to avoid java class being logged
        // along with the error message.
        if (e.getCause() != null) {
            throw new BallerinaException("Failed to " + operation + " due to malformed json: " + 
                    e.getCause().getMessage());
        } else {
            throw new BallerinaException("Failed to " + operation + " due to malformed json: " + e.getMessage());
        }
    }
/**
     * Handle any malformed json exception.
     * 
     * @param operation     Operation that executed
     * @param e             Exception to handle
     */
Handle any malformed json exception.

@param operation     Operation that executed
@param e             Exception to handle
Handle any malformed json exception . @param operation Operation that executed @param e Exception to handle
public static void handleMalformedJson(String operation, Exception e) {
        if (e.getCause() != null) {
            throw new BallerinaException("Failed to " + operation + " due to malformed json: " + 
                    e.getCause().getMessage());
        } else {
            throw new BallerinaException("Failed to " + operation + " due to malformed json: " + e.getMessage());
        }
    }
public static void handleMalformedJson ( String operation , Exception e ) { if ( e . getCause ( ) != null ) { throw new BallerinaException ( "Failed to " + operation + " due to malformed json: " + e . getCause ( ) . getMessage ( ) ) ; } else { throw new BallerinaException ( "Failed to " + operation + " due to malformed json: " + e . getMessage ( ) ) ; } }
Handle any malformed json exception.
Handle any malformed json exception .
// here local message of the cause is logged whenever possible, to avoid java class being logged // along with the error message.