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:
ajohnsen@google.com 2013-04-08 08:28:16 +00:00
parent 66455f6e2a
commit 4a2f6c1ce7

View file

@ -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");
}
}
}