Beginner
Date of registration: Nov 14th 2009
Location: Krugersdorp, South Africa
Occupation: Linux Opensource Consultant
Hobbies: Programming
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Public Sub Command1_Click() Dim i As Integer On Error Goto ErrHandler i = 1 i = i \ (i - i) Exit Sub ErrHandler: MsgBox "got me!" End Sub |
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public void Command1_Click() { Throwable Err; Err = null; int i = 0; int i = 1; i = (int)((long)i / (long)(i - i)); goto _L1 _L2: Interaction.MsgBox("got me!"); _L1: return; Err; goto _L2 } |
This post has been edited 2 times, last edit by "A1880" (Jan 14th 2010, 10:41pm)
Beginner
Date of registration: Nov 14th 2009
Location: Krugersdorp, South Africa
Occupation: Linux Opensource Consultant
Hobbies: Programming
Beginner
Date of registration: Nov 14th 2009
Location: Krugersdorp, South Africa
Occupation: Linux Opensource Consultant
Hobbies: Programming
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
This post has been edited 1 times, last edit by "A1880" (Jan 14th 2010, 10:04pm)
Beginner
Date of registration: Nov 14th 2009
Location: Krugersdorp, South Africa
Occupation: Linux Opensource Consultant
Hobbies: Programming
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Beginner
Date of registration: Nov 14th 2009
Location: Krugersdorp, South Africa
Occupation: Linux Opensource Consultant
Hobbies: Programming
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Public Function JabacoErrorManager (MyError As String, MyAction As String, FullErrorMessage As String) 'Dim variables to use Dim AddEnter As String 'Print To Console for Debug Debug().Print(MyError) 'Line Feed AddEnter = Chr(10) 'This is how we will handle the error Select Case MyError 'Java Sql Exception Case "java.sql.SQLException": MsgBox "Error: " & MyError & AddEnter & "Action: " & MyAction & AddEnter & "Fix: " & "Confirm the database server is online and try again, System will Exit now", vbOKOnly, "Critical System Error" System.exit 0 Case "java.lang.ArithmeticException": MsgBox "Error: " & MyError & AddEnter & "Action: " & MyAction & AddEnter & "Fix: " & "Confirm that there is no division by zero exception", vbOKOnly, "Critical System Error" Case Else MsgBox "Error: " & MyError & AddEnter & "Action: " & "Unknown" & AddEnter & "Fix: " & "None" & AddEnter & AddEnter & "Full Debug Information: " & FullErrorMessage , vbOKOnly, "Critical System Error" End Select End Function |
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
Public Sub Command1_Click() Dim i As Integer On Error Goto ErrHandler i = 1 i = i \ (i - i) ErrHandler: JabacoErrorManager (Err.getClass.getName, "While Connecting to MySQL Server",Err.getMessage) End Sub |
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
Option Explicit Public Sub Command1_Click() Dim i As Integer On Error Goto ErrHandler Call f1 Debug.Print "click: back again!" Exit Sub ErrHandler: MsgBox "click: " & Err.getMessage End Sub Private Sub f1 Dim i As Integer On Error Resume Next i = i \ (i - i) If Err <> Null Then Debug.Print "f1: '" & Err.getMessage & "'" ' switch on exception handling On Error Goto 0 ' back To error handler one calling layer above Throw New Exception("something went wrong! " & Err.getMessage & vbcrlf & "(" & Err.toString & ")") Else Debug.Print "f1: alright!" End If End Sub |