From 1ac80feb1c68aca677346f797fbeec318b5a8aad Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Fri, 5 Oct 2018 17:37:18 -0700 Subject: [PATCH] Replace panic with error on windows for symlink --- src/ops.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ops.rs b/src/ops.rs index 81009405ce..aa662cb164 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -2,8 +2,7 @@ use errors; use errors::permission_denied; -use errors::DenoError; -use errors::DenoResult; +use errors::{DenoError, DenoResult, ErrorKind}; use fs as deno_fs; use isolate::Buf; use isolate::Isolate; @@ -967,7 +966,10 @@ fn op_symlink( } // TODO Use type for Windows. if cfg!(windows) { - panic!("symlink for windows is not yet implemented") + return odd_future(errors::new( + ErrorKind::Other, + "symlink for windows is not yet implemented".to_string(), + )); } let inner = base.inner_as_symlink().unwrap();