Beispiel #1
0
 private static void WriteReject(IJSValueWriter writer, Exception exception)
 {
     ReactPromiseWriter.WriteError(writer,
                                   code: exception.HResult == 0 ? null : exception.HResult.ToString(),
                                   message: exception.Message,
                                   userInfo: null,
                                   stackTrace: exception.StackTrace);
 }
Beispiel #2
0
        // Reject the ReactPromise and report an error.
        public void Reject(ReactError error)
        {
            if (m_reject != null)
            {
                ReactPromiseWriter.WriteError(m_writer,
                                              code: error?.Code,
                                              message: error?.Message,
                                              userInfo: error?.UserInfo,
                                              stackTrace: error?.Exception?.StackTrace);
                m_reject(m_writer);
            }

            Clear();
        }