Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
ObjectUtils call to object's fromNative now wrapped in a try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Malachi Griffie committed Mar 5, 2014
1 parent 621a43a commit be02fae
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/nexus/utils/ObjectUtils.as
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2011 Malachi Griffie <[email protected]>
//
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand All @@ -13,7 +13,7 @@ import nexus.utils.reflection.*;

/**
* ...
*
*
*/
public class ObjectUtils
{
Expand Down Expand Up @@ -66,7 +66,14 @@ public class ObjectUtils
&& methodInfo.parameters.length == 1
&& methodInfo.parameters[0].type == Object)
{
result = methodInfo.invoke(type, source);
try
{
result = methodInfo.invoke(type, source);
}
catch(e:Error)
{
trace(e);
}
}
else
{
Expand All @@ -78,6 +85,7 @@ public class ObjectUtils
catch(e:Error)
{
//probably because ctor requires arguments, if we add support for that then this can catch more interesting errors
trace(e);
}
}

Expand Down Expand Up @@ -160,6 +168,7 @@ public class ObjectUtils
catch(e:Error)
{
//TODO: is a catch-all here ok?
trace(e);
}
}
else
Expand Down

0 comments on commit be02fae

Please sign in to comment.