@@ -52,36 +52,34 @@ impl WatchEnvTracker {
5252 }
5353
5454 // Consolidated error handling function
55- fn handle_dotenvy_error (
56- error : dotenvy :: Error ,
55+ fn handle_dotenv_error (
56+ error : deno_dotenv :: Error ,
5757 file_path : & Path ,
5858 log_level : Option < log:: Level > ,
5959 ) {
6060 #[ allow( clippy:: print_stderr) ]
6161 if log_level. map ( |l| l >= log:: Level :: Info ) . unwrap_or ( true ) {
6262 match error {
63- dotenvy :: Error :: LineParse ( line, index) => eprintln ! (
63+ deno_dotenv :: Error :: LineParse ( line, index) => eprintln ! (
6464 "{} Parsing failed within the specified environment file: {} at index: {} of the value: {}" ,
6565 colors:: yellow( "Warning" ) ,
6666 file_path. display( ) ,
6767 index,
6868 line
6969 ) ,
70- dotenvy:: Error :: Io ( _) => eprintln ! (
71- "{} The `--env-file` flag was used, but the environment file specified '{}' was not found." ,
72- colors:: yellow( "Warning" ) ,
73- file_path. display( )
74- ) ,
75- dotenvy:: Error :: EnvVar ( _) => eprintln ! (
76- "{} One or more of the environment variables isn't present or not unicode within the specified environment file: {}" ,
77- colors:: yellow( "Warning" ) ,
78- file_path. display( )
79- ) ,
80- _ => eprintln ! (
81- "{} Unknown failure occurred with the specified environment file: {}" ,
82- colors:: yellow( "Warning" ) ,
83- file_path. display( )
84- ) ,
70+ deno_dotenv:: Error :: Io ( e) => match e. kind ( ) {
71+ std:: io:: ErrorKind :: NotFound => eprintln ! (
72+ "{} The `--env-file` flag was used, but the environment file specified '{}' was not found." ,
73+ colors:: yellow( "Warning" ) ,
74+ file_path. display( ) ,
75+ ) ,
76+ _ => eprintln ! (
77+ "{} Error reading from environment file '{}': {}." ,
78+ colors:: yellow( "Warning" ) ,
79+ file_path. display( ) ,
80+ e,
81+ ) ,
82+ } ,
8583 }
8684 }
8785 }
@@ -107,7 +105,7 @@ impl WatchEnvTracker {
107105 return ;
108106 }
109107
110- match dotenvy :: from_path_iter ( & file_path) {
108+ match deno_dotenv :: from_path_sanitized_iter ( & file_path) {
111109 Ok ( iter) => {
112110 for item in iter {
113111 match item {
@@ -148,7 +146,7 @@ impl WatchEnvTracker {
148146 inner. unused_variables . remove ( & key_os) ;
149147 }
150148 Err ( e) => {
151- Self :: handle_dotenvy_error ( e, & file_path, log_level) ;
149+ Self :: handle_dotenv_error ( e, & file_path, log_level) ;
152150 }
153151 }
154152 }
@@ -244,10 +242,10 @@ pub fn load_env_variables_from_env_files(
244242 } ;
245243
246244 for env_file_name in env_file_names. iter ( ) . rev ( ) {
247- match dotenvy :: from_filename ( env_file_name) {
245+ match deno_dotenv :: from_path ( env_file_name) {
248246 Ok ( _) => ( ) ,
249247 Err ( error) => {
250- WatchEnvTracker :: handle_dotenvy_error (
248+ WatchEnvTracker :: handle_dotenv_error (
251249 error,
252250 env_file_name,
253251 flags_log_level,
0 commit comments