mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Add missing method to link.dart.
BUG= Review URL: https://codereview.chromium.org//13775005 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21052 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
66455f6e2a
commit
4a2f6c1ce7
1 changed files with 16 additions and 0 deletions
|
@ -207,6 +207,22 @@ class _Link extends FileSystemEntity implements Link {
|
|||
_fileService = _FileUtils._newServicePort();
|
||||
}
|
||||
}
|
||||
|
||||
_exceptionFromResponse(response, String message) {
|
||||
assert(_isErrorResponse(response));
|
||||
switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
|
||||
case _ILLEGAL_ARGUMENT_RESPONSE:
|
||||
return new ArgumentError();
|
||||
case _OSERROR_RESPONSE:
|
||||
var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
|
||||
response[_OSERROR_RESPONSE_ERROR_CODE]);
|
||||
return new FileIOException(message, err);
|
||||
case _FILE_CLOSED_RESPONSE:
|
||||
return new FileIOException("File closed");
|
||||
default:
|
||||
return new Exception("Unknown error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue