summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eo_mono
diff options
context:
space:
mode:
authorBruno da Silva Belo <brunodasilvabelo@gmail.com>2019-10-28 11:59:52 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-28 12:21:01 -0300
commit898ced96f68fbbc186617e54b9adf16f4eff5197 (patch)
treeb27a0d4c34dd917f75e8818c7050dbf38ee9392e /src/bindings/mono/eo_mono
parent5299a65d453b59e16cd48741c65974a1fae34916 (diff)
csharp: Add missing exception ctr from iwrapper.
Summary: ref T8392 Reviewers: felipealmeida, lauromoura, segfaultxavi, YOhoho Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8392 Differential Revision: https://phab.enlightenment.org/D10454
Diffstat (limited to 'src/bindings/mono/eo_mono')
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs93
1 files changed, 82 insertions, 11 deletions
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index d9ae4e5..8ba47b4 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -573,7 +573,7 @@ public static class Globals
573 } 573 }
574 else 574 else
575 { 575 {
576 tcs.TrySetException(new Efl.FutureException(received)); 576 tcs.TrySetException(new Efl.FutureException(err));
577 } 577 }
578 } 578 }
579 else 579 else
@@ -1383,10 +1383,29 @@ public class StrbufKeepOwnershipMarshaler: ICustomMarshaler
1383/// <summary>General exception for errors inside the binding.</summary> 1383/// <summary>General exception for errors inside the binding.</summary>
1384public class EflException : Exception 1384public class EflException : Exception
1385{ 1385{
1386 /// <summary>
1387 /// Default Constructor.
1388 /// <para>Since EFL 1.23.</para>
1389 /// </summary>
1390 public EflException()
1391 {
1392 }
1393
1386 /// <summary>Create a new EflException with the given message.</summary> 1394 /// <summary>Create a new EflException with the given message.</summary>
1387 public EflException(string message) : base(message) 1395 public EflException(string message) : base(message)
1388 { 1396 {
1389 } 1397 }
1398
1399 /// <summary>
1400 /// Create a new EflException with the given message and inner exception.
1401 /// <para>Since EFL 1.23.</para>
1402 /// </summary>
1403 /// <param name="message">The message of the exception.</param>
1404 /// <param name="innerException">The inner exception.</param>
1405 public EflException(string message, Exception innerException)
1406 : base(message, innerException)
1407 {
1408 }
1390} 1409}
1391 1410
1392/// <summary>Exception to be raised when a Task fails due to a failed Eina.Future.</summary> 1411/// <summary>Exception to be raised when a Task fails due to a failed Eina.Future.</summary>
@@ -1395,18 +1414,70 @@ public class FutureException : EflException
1395 /// <summary>The error code returned by the failed Eina.Future.</summary> 1414 /// <summary>The error code returned by the failed Eina.Future.</summary>
1396 public Eina.Error Error { get; private set; } 1415 public Eina.Error Error { get; private set; }
1397 1416
1398 /// <summary>Construct a new exception from the Eina.Error stored in the given Eina.Value.</summary> 1417 /// <summary>
1399 public FutureException(Eina.Value value) : base("Future failed.") 1418 /// Default constructor.
1419 /// <para>Since EFL 1.23.</para>
1420 /// </summary>
1421 public FutureException() : this(Eina.Error.UNHANDLED_EXCEPTION)
1400 { 1422 {
1401 if (value.GetValueType() != Eina.ValueType.Error) 1423 }
1402 {
1403 throw new ArgumentException("FutureException must receive an Eina.Value with Eina.Error.");
1404 }
1405 1424
1406 Eina.Error err; 1425 /// <summary>
1407 value.Get(out err); 1426 /// Construct a new exception from the <see cref="Eina.Error" />
1408 Error = err; 1427 /// with a given message
1428 /// <para>Since EFL 1.23.</para>
1429 /// </summary>
1430 /// <param name="message">The message of the exception.</param>
1431 public FutureException(string message)
1432 : this(Eina.Error.UNHANDLED_EXCEPTION, message)
1433 {
1409 } 1434 }
1410}
1411 1435
1436 /// <summary>
1437 /// Construct a new exception from the <see cref="Eina.Error" />
1438 /// with a given message and inner exception.
1439 /// <para>Since EFL 1.23.</para>
1440 /// </summary>
1441 /// <param name="message">The message of the exception.</param>
1442 /// <param name="innerException">The inner exception.</param>
1443 public FutureException(string message, Exception innerException)
1444 : this(Eina.Error.UNHANDLED_EXCEPTION, message, innerException)
1445 {
1446 }
1447
1448 /// <summary>
1449 /// Construct a new exception from the <see cref="Eina.Error" />
1450 /// with a given error.
1451 /// <para>Since EFL 1.23.</para>
1452 /// </summary>
1453 /// <param name="error">The error of the exception..</param>
1454 public FutureException(Eina.Error error)
1455 : this(error, "Future failed.")
1456 {
1457 }
1458
1459 /// <summary>
1460 /// Construct a new exception from the <see cref="Eina.Error" />
1461 /// with a given error and message.
1462 /// <para>Since EFL 1.23.</para>
1463 /// </summary>
1464 /// <param name="error">The error of the exception..</param>
1465 /// <param name="message">The message of the exception.</param>
1466 public FutureException(Eina.Error error, string message)
1467 : this(error, message, null)
1468 {
1469 }
1470
1471 /// <summary>
1472 /// Construct a new exception from the <see cref="Eina.Error" />
1473 /// with a given error, message and innerException.
1474 /// <para>Since EFL 1.23.</para>
1475 /// </summary>
1476 /// <param name="error">The error of the exception..</param>
1477 /// <param name="message">The message of the exception.</param>
1478 /// <param name="innerException">The inner exception.</param>
1479 public FutureException(Eina.Error error, string message,
1480 Exception innerException)
1481 : base(message, innerException) => Error = error;
1482}
1412} // namespace efl 1483} // namespace efl