Renamed error import
This commit is contained in:
parent
31a390f25f
commit
97b67a7713
16
src/lib.rs
16
src/lib.rs
@ -1,4 +1,4 @@
|
|||||||
#![doc = include_str!("../.github/README.md")]
|
#[doc = include_str!("../.github/README.md")]
|
||||||
// localizer-rs
|
// localizer-rs
|
||||||
// Version: 1.1.0
|
// Version: 1.1.0
|
||||||
|
|
||||||
@ -37,8 +37,6 @@ use std::fs::File;
|
|||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use errors as error_lib;
|
|
||||||
|
|
||||||
use serde_json;
|
use serde_json;
|
||||||
|
|
||||||
|
|
||||||
@ -155,14 +153,14 @@ impl Config {
|
|||||||
match path.try_exists() {
|
match path.try_exists() {
|
||||||
Ok(value) => {
|
Ok(value) => {
|
||||||
if !value {
|
if !value {
|
||||||
let error: error_lib::Error =
|
let error: errors::Error =
|
||||||
error_lib::Error::new("OS Error", "Translation path was not found", 1);
|
errors::Error::new("OS Error", "Translation path was not found", 1);
|
||||||
error.raise(format!("Path: {:?}", str_path).as_str());
|
error.raise(format!("Path: {:?}", str_path).as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(_error) => {
|
Err(_error) => {
|
||||||
let error: error_lib::Error =
|
let error: errors::Error =
|
||||||
error_lib::Error::new("OS Error", "Could not open path", 2);
|
errors::Error::new("OS Error", "Could not open path", 2);
|
||||||
error.raise(format!("Path: {:?}\nDetails: {}", str_path, _error).as_str());
|
error.raise(format!("Path: {:?}\nDetails: {}", str_path, _error).as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -170,8 +168,8 @@ impl Config {
|
|||||||
self.path = String::from(match path.to_owned().to_str() {
|
self.path = String::from(match path.to_owned().to_str() {
|
||||||
Some(value) => value,
|
Some(value) => value,
|
||||||
None => {
|
None => {
|
||||||
let error: error_lib::Error =
|
let error: errors::Error =
|
||||||
error_lib::Error::new("OS Error", "Path does not seem to be valid", 3);
|
errors::Error::new("OS Error", "Path does not seem to be valid", 3);
|
||||||
error.raise(format!("Path: {:?}", str_path).as_str());
|
error.raise(format!("Path: {:?}", str_path).as_str());
|
||||||
""
|
""
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user