You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.unwrap_or_else(|err| panic!("{}, failed to parse `{}` as a socket address. Please set the environment variable `P_ADDR` to `<ip address>:<port>` without the scheme (e.g., 192.168.1.1:8000). Please refer to the documentation: https://logg.ing/env for more details.",
Copy file name to clipboardExpand all lines: server/src/utils.rs
+32-10Lines changed: 32 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -238,13 +238,21 @@ pub fn get_url() -> Url {
238
238
CONFIG.parseable.address
239
239
)
240
240
.parse::<Url>()// if the value was improperly set, this will panic before hand
241
-
.expect("Valid URL");
241
+
.unwrap_or_else(|err| panic!("{}, failed to parse `{}` as Url. Please set the environment variable `P_ADDR` to `<ip address>:<port>` without the scheme (e.g., 192.168.1.1:8000). Please refer to the documentation: https://logg.ing/env for more details.",
242
+
err,CONFIG.parseable.address));
243
+
}
244
+
245
+
let ingestor_endpoint = &CONFIG.parseable.ingestor_endpoint;
246
+
247
+
if ingestor_endpoint.starts_with("http"){
248
+
panic!("Invalid value `{}`, please set the environement variable `P_INGESTOR_ENDPOINT` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.", ingestor_endpoint);
249
+
}
250
+
251
+
let addr_from_env = ingestor_endpoint.split(':').collect::<Vec<&str>>();
252
+
253
+
if addr_from_env.len() != 2{
254
+
panic!("Invalid value `{}`, please set the environement variable `P_INGESTOR_ENDPOINT` to `<ip address / DNS>:<port>` without the scheme (e.g., 192.168.1.1:8000 or example.com:8000). Please refer to the documentation: https://logg.ing/env for more details.", ingestor_endpoint);
panic!("The environement variable `{}` is not set, please set as <ip address / DNS> without the scheme (e.g., 192.168.1.1 or example.com). Please refer to the documentation: https://logg.ing/env for more details.", var_hostname);
268
+
}
269
+
if hostname.starts_with("http"){
270
+
panic!("Invalid value `{}`, please set the environement variable `{}` to `<ip address / DNS>` without the scheme (e.g., 192.168.1.1 or example.com). Please refer to the documentation: https://logg.ing/env for more details.", hostname, var_hostname);
0 commit comments