added snippet to create NSError instances