Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 1 addition & 175 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/toolchain/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ edition.workspace = true
name = "rivet"
path = "src/main.rs"

[features]
default = ["sentry"]
sentry = []
# [features]
# default = ["sentry"]
# sentry = []

[dependencies]
clap = { version = "4.5.9", features = ["derive"] }
Expand All @@ -26,7 +26,7 @@ base64 = "0.22.1"
kv-str.workspace = true
inquire = "0.7.5"
webbrowser = "1.0.2"
sentry = { version = "0.37.0", default-features = false, features = ["anyhow", "backtrace", "contexts", "debug-images", "panic", "reqwest", "rustls"] }
# sentry = { version = "0.37.0", default-features = false, features = ["anyhow", "backtrace", "contexts", "debug-images", "panic", "reqwest", "rustls"] }
sysinfo = "0.32.0"
ctrlc = "3.4.5"
async-posthog.workspace = true
Expand Down
40 changes: 20 additions & 20 deletions packages/toolchain/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ struct Cli {
}

fn main() -> ExitCode {
// We use a sync main for Sentry. Read more: https://docs.sentry.io/platforms/rust/#async-main-function

// This has a 2 second deadline to flush any remaining events which is sufficient for
// short-lived commands.
let _guard = sentry::init(("https://b329eb15c63e1002611fb3b7a58a1dfa@o4504307129188352.ingest.us.sentry.io/4508361147809792", sentry::ClientOptions {
release: sentry::release_name!(),
..Default::default()
}));
// // We use a sync main for Sentry. Read more: https://docs.sentry.io/platforms/rust/#async-main-function
//
// // This has a 2 second deadline to flush any remaining events which is sufficient for
// // short-lived commands.
// let _guard = sentry::init(("https://b329eb15c63e1002611fb3b7a58a1dfa@o4504307129188352.ingest.us.sentry.io/4508361147809792", sentry::ClientOptions {
// release: sentry::release_name!(),
// ..Default::default()
// }));

// Run main
let exit_code = tokio::runtime::Builder::new_multi_thread()
Expand Down Expand Up @@ -81,18 +81,18 @@ async fn main_async() -> ExitCode {
exit_code
}

async fn report_error(err: anyhow::Error) {
let event_id = sentry::integrations::anyhow::capture_anyhow(&err);
async fn report_error(_err: anyhow::Error) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

style: report_error function is now a no-op but still being called on line 71, consider removing the call entirely if error reporting is disabled

Suggested change
async fn report_error(_err: anyhow::Error) {
// This is an internal error, report error
eprintln!("\n{err}");

// let event_id = sentry::integrations::anyhow::capture_anyhow(&err);

// Capture event in PostHog
util::telemetry::capture_event(
"$exception",
Some(|event: &mut async_posthog::Event| {
event.insert_prop("errors", format!("{}", err))?;
event.insert_prop("$sentry_event_id", event_id.to_string())?;
event.insert_prop("$sentry_url", format!("https://sentry.io/organizations/rivet-gaming/issues/?project=4508361147809792&query={event_id}"))?;
Ok(())
}),
)
.await;
// util::telemetry::capture_event(
// "$exception",
// Some(|event: &mut async_posthog::Event| {
// event.insert_prop("errors", format!("{}", err))?;
// event.insert_prop("$sentry_event_id", event_id.to_string())?;
// event.insert_prop("$sentry_url", format!("https://sentry.io/organizations/rivet-gaming/issues/?project=4508361147809792&query={event_id}"))?;
// Ok(())
// }),
// )
// .await;
}
Loading