-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v2.0.1 Minor changes, updates, additions, and refactoring.
- Loading branch information
Showing
28 changed files
with
516 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ChromeDroid_TabMan.Auxiliary.Exceptions | ||
{ | ||
public class AdbDeviceNotFoundException : Exception | ||
{ | ||
public AdbDeviceNotFoundException() : base("ERROR: ADB device either is not connected or was not found.") { } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Windows.Forms; | ||
|
||
public static class GlobalUnhandledExceptionHandler | ||
{ | ||
public static void Initialize() | ||
{ | ||
Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException); | ||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); | ||
} | ||
|
||
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e) | ||
{ | ||
Exception ex = e.Exception; | ||
MessageBox.Show(ex.Message, $"Error: (unhandled exception: {ex.GetType().Name})", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
//write stack trace somewhere? and/or add logging? | ||
} | ||
|
||
private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) | ||
{ | ||
Exception ex = e.ExceptionObject as Exception; | ||
if (ex != null) | ||
{ | ||
MessageBox.Show("An unexpected error occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ChromeDroid_TabMan.Auxiliary.Exceptions | ||
{ | ||
public class PidNotParsedException : Exception | ||
{ | ||
public PidNotParsedException(string message = "PID could not be found or parsed. One possibility is that the process may not be running.") : base(message) | ||
{ | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.