Implemented error handling for XBlock instances