/// Constructor for creating a new channel with a sender and a receiver.
/// </summary>
/// <exception cref="OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
/// <example>
/// <code>
///
/// <param name="id">The ID.</param>
/// <param name="data">The data object.</param>
/// <exception cref="OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
/// <example>
/// <code>
///
/// Constructor for creating a new event instance.
/// </summary>
/// <exception cref="OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
/// <example>
/// <code>
///
/// </summary>
/// <param name="eventObject">The event object instance.</param>
/// <exception cref="ArgumentNullException">Thrown when the argument is null.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
/// <remarks>
/// If the event is not added to the task, the emitted event object will be pended until the event is added to the task.
/// </remarks>
}
Interop.LibTizenCore.ErrorCode error = Interop.LibTizenCore.TizenCoreEvent.Emit(_handle, eventObject.Handle);
+ if (error == Interop.LibTizenCore.ErrorCode.InvalidParameter)
+ {
+ error = Interop.LibTizenCore.ErrorCode.InvalidContext;
+ }
TCoreErrorFactory.CheckAndThrownException(error, "Failed to emit event object");
eventObject.Handle = IntPtr.Zero;
}
/// <param name="id">The ID.</param>
/// <param name="data">The data object.</param>
/// <exception cref="OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
/// <example>
/// <code>
///
/// <param name="id">The ID of the task.</param>
/// <exception cref="ArgumentException">Thrown when the <paramref name="id"/> is invalid or a Task with that ID already exists.</exception>
/// <exception cref="OutOfMemoryException">Thrown when out of memory.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when failed because of an invalid operation.</exception>
/// <remarks>
/// The constructor throws an exception when the id already exists.
/// By default, the task creates a thread. However, if the <paramref name="id"/> is "main", a thread is not created.
return null;
}
- var task = new Task(id);
- task.Run();
- return task;
+ try
+ {
+ var task = new Task(id);
+ task.Run();
+ return task;
+ }
+ catch (ArgumentException)
+ {
+ Log.Error("ArgumentException occurs");
+ }
+ catch (OutOfMemoryException)
+ {
+ Log.Error("OutOfMemoryException occurs");
+ }
+ catch (InvalidOperationException)
+ {
+ Log.Error("InvalidOperationException occurs");
+ }
+
+ return null;
}
/// <summary>