Watch
2
0
Fork
You've already forked raylib-cs
0

Better error handlingfor examples

This commit is contained in:
Rgebee 2018-10-25 12:29:10 +01:00
commit f7ab1fbd7a

View file

@ -1,6 +1,8 @@
using System;
using System.IO;
using static Raylib.Raylib;
using System.Reflection;
using System.Runtime.InteropServices;
namespace Examples
{
@ -37,7 +39,15 @@ namespace Examples
if (File.Exists(dir))
{
ChangeDirectory(Path.GetDirectoryName(dir));
try
{
Type.GetType(name)?.GetMethod("Main")?.Invoke(null, args);
}
catch(TargetInvocationException e)
{
Console.WriteLine(e.InnerException.Message);
Console.WriteLine(e.InnerException.StackTrace);
}
Console.WriteLine();
}
else