Skip to content

Instantly share code, notes, and snippets.

var crucialData = new CrucialData(); // define an object however you do in your language
LogglyLogLoggerServiceGlobalSingletonInstance.log_remotely({crucialData: crucialData});
public ActionResult Index()
{
int myNumber1 = 0;
int myNumber2 = 1;
try
{
int result = DivideNumbers(3, 4);
} catch (Exception e)
{
// do something
public ActionResult Index()
{
try
{
// all of your code here
} catch (Exception e)
{
// do something
}
int myNumber = DivideNumbers(1, 0);
private int DivideNumbers(x, y)
{
return x/y;
}
try
{
int x = 1/0;
}
catch(DivideByZeroException e )
{
EventLog.WriteEntry(sourceApplication, eventName, EventLogEntryType.Warning);
}
string sourceApplication = “My App”;
string logName = “Application”;
string eventName = “Login Error”;
try
{
int x = 1/0;
}
catch(DivideByZeroException e )
{
// What you want to do when the error is thrown
}
try
{
int x = 1/0;
}
catch(DivideByZeroException e )
{
// What you want to do when the error is thrown
}
try
{
// Your code that might throw an error
}
catch( ExceptionName e )
{
// What you want to do when the error is thrown
}
try
{
// Your code that might throw an error
}
catch( ExceptionName e )
{
// What you want to do when the error is thrown
}