Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[green]// Main try/catch block[/green]
[blue]try[/blue]
{
[i]statement1;
statement2;
.
.
.
statnementn;[/i]
}
[blue]catch[/blue] ([i]ExpectedException[/i] e)
{
[green]// Call function to write to db[/green]
[blue]bool[/blue] writeOK = WriteToDB(...);
[blue]if[/blue] (writeOK)
[green]// Everything went OK[/green]
[blue]else[/blue]
[green]// Writing to the database failed[/green]
}
[blue]finally[/blue]
{...}
[green][b]// WriteToDB function[/b][/green]
[blue]private bool[/blue] WriteToDB(...)
{
[blue]try[/blue]
{
[i]statement1;
statement2;
.
.
.
statementn;[/i]
[blue]return true[/blue];
}
[blue]catch[/blue] ([i]SomeDataBaseException[/i] ex)
{
[green]...[/green]
[blue]return false[/blue];
}
}
[green]// In the main try/catch block...[/green]
[blue]catch[/blue] ([i]ExpectedException[/i] e)
{
[green]// Call function to write to db[/green]
[blue]bool[/blue] writeOK = WriteToDB(...);
[blue]if[/blue] (writeOK)
{
// Everything went OK
}
[blue]else[/blue]
{
[green][b]// Writing to the database failed
// Write to a file instead[/b][/green]
}
}
[green]...[/green]