bind .onerror to context