84836f8c56
This implements consistent error reporting on all methods on File in dart:io. The async onError method is called with an exception argument which is the same exception as would have been thrown from the corresponding sync method. The one method on Directory which already did this has been updated as well. R=ager@google.com BUG=none TEST=tests/standalone/src/io/FileTest.dart, tests/standalone/src/io/FileInvalidArgumentsTest.dart Review URL: https://chromiumcodereview.appspot.com//9630012 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5396 260f80e4-7a28-3924-810f-c04153c831b5
13 lines
361 B
C++
13 lines
361 B
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include <errno.h>
|
|
|
|
#include "bin/utils.h"
|
|
|
|
OSError::OSError() : code_(0), message_(NULL) {
|
|
set_code(errno);
|
|
SetMessage(strerror(errno));
|
|
}
|