1
1
using Jvedio . Core . Exceptions ;
2
+ using SuperControls . Style ;
2
3
using SuperUtils . Reflections ;
3
4
using System ;
4
5
using System . Collections . Generic ;
@@ -29,7 +30,8 @@ public Plugin(string dllPath, string methodName, object[] @params)
29
30
30
31
public async Task < object > InvokeAsyncMethod ( )
31
32
{
32
- if ( ! File . Exists ( DllPath ) ) throw new DllLoadFailedException ( DllPath ) ;
33
+ if ( ! File . Exists ( DllPath ) )
34
+ throw new DllLoadFailedException ( DllPath , LangManager . GetValueByKey ( "Message_FileNotExist" ) ) ;
33
35
Type classType = null ;
34
36
object instance = null ;
35
37
try
@@ -38,14 +40,16 @@ public async Task<object> InvokeAsyncMethod()
38
40
classType = getPublicType ( dll . GetTypes ( ) ) ;
39
41
instance = ReflectionHelper . TryCreateInstance ( classType , new object [ ] { Params [ 1 ] , Params [ 2 ] } ) ;
40
42
}
41
- catch ( Exception )
43
+ catch ( Exception ex )
42
44
{
43
- throw new DllLoadFailedException ( DllPath ) ;
45
+ throw new DllLoadFailedException ( DllPath , ex . Message ) ;
44
46
}
45
47
46
- if ( classType == null || instance == null ) throw new DllLoadFailedException ( DllPath ) ;
48
+ if ( classType == null || instance == null )
49
+ throw new DllLoadFailedException ( DllPath , "classType == null || instance == null" ) ;
47
50
MethodInfo methodInfo = classType . GetMethod ( MethodName ) ;
48
- if ( methodInfo == null ) throw new DllLoadFailedException ( DllPath ) ;
51
+ if ( methodInfo == null )
52
+ throw new DllLoadFailedException ( DllPath , "MethodInfo Null" ) ;
49
53
try
50
54
{
51
55
return await ( Task < Dictionary < string , object > > ) methodInfo .
0 commit comments