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

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

Issue 17638007: Create LinkExceptions using the right arguments, in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added test 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 | « no previous file | tests/standalone/io/link_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 955622fbebc7322859db217b31dea1e24191d0f9..a5cd3d1c64eda17bf642d3799bec6dd5dde6c77c 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -146,7 +146,7 @@ class _Link extends FileSystemEntity implements Link {
target = _makeWindowsLinkTarget(target);
}
var result = _File._createLink(path, target);
- throwIfError(result, "Cannot create link '$path'");
+ throwIfError(result, "Cannot create link", path);
}
// Put target into the form "\??\C:\my\target\dir".
@@ -188,7 +188,7 @@ class _Link extends FileSystemEntity implements Link {
void deleteSync() {
var result = _File._deleteLink(path);
- throwIfError(result, "Cannot delete link '$path'");
+ throwIfError(result, "Cannot delete link", path);
}
Future<String> target() {
@@ -207,13 +207,13 @@ class _Link extends FileSystemEntity implements Link {
String targetSync() {
var result = _File._linkTarget(path);
- throwIfError(result, "Cannot read link '$path'");
+ throwIfError(result, "Cannot read link", path);
return result;
}
- static throwIfError(Object result, String msg) {
+ static throwIfError(Object result, String msg, [String path = ""]) {
if (result is OSError) {
- throw new LinkException(msg, result);
+ throw new LinkException(msg, path, result);
}
}
@@ -245,8 +245,8 @@ class _Link extends FileSystemEntity implements Link {
class LinkException implements IOException {
const LinkException([String this.message = "",
- String this.path = "",
- OSError this.osError = null]);
+ String this.path = "",
+ OSError this.osError = null]);
String toString() {
StringBuffer sb = new StringBuffer();
sb.write("LinkException");
« no previous file with comments | « no previous file | tests/standalone/io/link_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698