Return error when moment fails to write