Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: sdk/lib/io/link.dart

Issue 18090003: Add FileException.path and clean up file exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: CLean up test and remove debug code. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tests/standalone/io/file_invalid_arguments_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index 0be59946d926a6aa3ea07f18fc721eebe50a2446..4fc0312b0fd9b0287aa1475c5fa3d5ebecac4fc2 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -154,8 +154,8 @@ class _Link extends FileSystemEntity implements Link {
request[2] = target;
return _fileService.call(request).then((response) {
if (_isErrorResponse(response)) {
- throw _exceptionFromResponse(response,
- "Cannot create link '$path' to target '$target'");
+ throw _exceptionFromResponse(
+ response, "Cannot create link to target '$target'", path);
}
return this;
});
@@ -204,7 +204,7 @@ class _Link extends FileSystemEntity implements Link {
request[1] = path;
return _fileService.call(request).then((response) {
if (_isErrorResponse(response)) {
- throw _exceptionFromResponse(response, "Cannot delete link '$path'");
+ throw _exceptionFromResponse(response, "Cannot delete link", path);
}
return this;
});
@@ -224,7 +224,7 @@ class _Link extends FileSystemEntity implements Link {
return _fileService.call(request).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
- response, "Cannot rename link '$path' to '$newPath'");
+ response, "Cannot rename link to '$newPath'", path);
}
return new Link(newPath);
});
@@ -243,8 +243,8 @@ class _Link extends FileSystemEntity implements Link {
request[1] = path;
return _fileService.call(request).then((response) {
if (_isErrorResponse(response)) {
- throw _exceptionFromResponse(response,
- "Cannot get target of link '$path'");
+ throw _exceptionFromResponse(
+ response, "Cannot get target of link", path);
}
return response;
});
@@ -272,7 +272,7 @@ class _Link extends FileSystemEntity implements Link {
}
}
- _exceptionFromResponse(response, String message) {
+ _exceptionFromResponse(response, String message, String path) {
assert(_isErrorResponse(response));
switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
case _ILLEGAL_ARGUMENT_RESPONSE:
@@ -280,7 +280,7 @@ class _Link extends FileSystemEntity implements Link {
case _OSERROR_RESPONSE:
var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
response[_OSERROR_RESPONSE_ERROR_CODE]);
- return new LinkException(message, err);
+ return new LinkException(message, path, err);
default:
return new Exception("Unknown error");
}
« no previous file with comments | « sdk/lib/io/file_system_entity.dart ('k') | tests/standalone/io/file_invalid_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698