Tried to create test to check onerror() functionality.