diff options
author | Mike Voorhees <mrvoorhe@users.noreply.github.com> | 2017-03-17 17:53:38 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-03-17 17:53:38 +0300 |
commit | 4c49bea86e854ac9c4391efd5e7e54a764be5998 (patch) | |
tree | 1eac14be8271218800f73ec5b9e3f8dc0068fa51 /linker | |
parent | d905b3a540f08bcbd8b81f62f6677426d6b896f0 (diff) |
Improve error message (#32)
Diffstat (limited to 'linker')
-rw-r--r-- | linker/Mono.Linker.Steps/MarkStep.cs | 9 | ||||
-rw-r--r-- | linker/Mono.Linker.csproj | 1 | ||||
-rw-r--r-- | linker/Mono.Linker/MarkException.cs | 17 |
3 files changed, 25 insertions, 2 deletions
diff --git a/linker/Mono.Linker.Steps/MarkStep.cs b/linker/Mono.Linker.Steps/MarkStep.cs index 1f4308aad..b6c1e291d 100644 --- a/linker/Mono.Linker.Steps/MarkStep.cs +++ b/linker/Mono.Linker.Steps/MarkStep.cs @@ -153,8 +153,13 @@ namespace Mono.Linker.Steps { while (!QueueIsEmpty ()) { MethodDefinition method = (MethodDefinition) _methods.Dequeue (); Annotations.Push (method); - ProcessMethod (method); - Annotations.Pop (); + try { + ProcessMethod (method); + } catch (Exception e) { + throw new MarkException (string.Format ("Error processing method: '{0}' in assembly: '{1}'", method.FullName, method.Module.Name), e); + } finally { + Annotations.Pop (); + } } } diff --git a/linker/Mono.Linker.csproj b/linker/Mono.Linker.csproj index 8674b6311..bb885f44d 100644 --- a/linker/Mono.Linker.csproj +++ b/linker/Mono.Linker.csproj @@ -68,6 +68,7 @@ <Compile Include="Mono.Linker\DirectoryAssemblyResolver.cs" /> <Compile Include="Mono.Linker\Driver.cs" /> <Compile Include="Mono.Linker\LinkContext.cs" /> + <Compile Include="Mono.Linker\MarkException.cs" /> <Compile Include="Mono.Linker\MethodAction.cs" /> <Compile Include="Mono.Linker\Pipeline.cs" /> <Compile Include="Mono.Linker\TypePreserve.cs" /> diff --git a/linker/Mono.Linker/MarkException.cs b/linker/Mono.Linker/MarkException.cs new file mode 100644 index 000000000..908e1588e --- /dev/null +++ b/linker/Mono.Linker/MarkException.cs @@ -0,0 +1,17 @@ +using System; + +namespace Mono.Linker +{ + public class MarkException : Exception + { + public MarkException (string message) + : base (message) + { + } + + public MarkException (string message, Exception innerException) + : base (message, innerException) + { + } + } +} |