mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-09 06:15:49 +02:00
Add custom exception messages to file reading in PluginBridge
This commit is contained in:
parent
fb3d9e6d6b
commit
6dd2c6678b
@ -73,7 +73,13 @@ public string ReadFile(int token, string path, bool cache){
|
||||
return cachedContents;
|
||||
}
|
||||
|
||||
return fileCache[fullPath] = File.ReadAllText(fullPath, Encoding.UTF8);
|
||||
try{
|
||||
return fileCache[fullPath] = File.ReadAllText(fullPath, Encoding.UTF8);
|
||||
}catch(FileNotFoundException){
|
||||
throw new Exception("File not found.");
|
||||
}catch(DirectoryNotFoundException){
|
||||
throw new Exception("Directory not found.");
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteFile(int token, string path){
|
||||
|
Loading…
Reference in New Issue
Block a user