Added condition to default error handler.
Added error handling to device class.
Added error handling constructors to context class.
Slightly optimized error handling code in device and platform classes.
Device class should now exhibit proper behavior.