added error for failed canvas.getContext