Use a proper error type for window creation