Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return suitable string when error occur #34 #39

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

junppyo
Copy link
Contributor

@junppyo junppyo commented Jun 7, 2023

change unwrap to expect

let matched = pattern.captures(out).unwrap();

let matched = pattern.captures(out).expect("failed to parse cbs schedule");

and change necessary last_os_error to error msg

Err(_) => Err(format!("Create vlan fails {}", Error::last_os_error())),

Err(e) => Err(format!("Create vlan fails {}", e)),

junppyo and others added 15 commits May 8, 2023 10:01
* get rx, tx timestamp

* no more call SystemTime::now() on oneway mode

* fix cargo fmt

* print only rx timestamp

* fix fmt
* Implement HW TX timestamp

Even if failed to set HW TX timestamp, SW TX timestamp is still can be
used.

* Cargo fmt, Clippy

* Remove perror

* Remove print, fix typo
* change protocol

* fix fmt, clippy

* change server get rx by packet, clean code

* server identifies act as opcode

* store ts only last one and server don't get oneway parameter

* get SW timestamp immediately after receive the message

* clean code

* change opcode match in server

* error handling about negative elapsed time

* fix fmt, clippy

* server prints negative elapsed time

* simplify get tx_timestamp at packet

* fix fmt
if !tc_map.contains_key(&prio.as_i64().unwrap()) {
tc_map.insert(prio.as_i64().unwrap(), tc_map.len() as i64);
for (prio, priomap) in config.as_mapping().expect("failed to parse cbs schedule") {
if !tc_map.contains_key(&prio.as_i64().expect("failed to parse cbs schedule")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Failed to parse 'prio' as integer" is more precise error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants