[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Show full anyhow error messages

Kasper (Jun 9, 2026, 3:13 AM +0200) 1d044681 7cb4f440

+16 -3
+2 -1
src-native/data.rs
··· 1 1 use crate::library::{Paths, load_old_library_json, open_library}; 2 2 use crate::library_types::Library; 3 3 use crate::tracks::Tag; 4 - use anyhow::{Context, Result}; 4 + use anyhow::Context; 5 5 use atomicwrites::{AllowOverwrite, AtomicFile}; 6 6 use dirs_next; 7 + use napi::Result; 7 8 use serde::Serialize; 8 9 use sqlx::SqliteConnection; 9 10 use std::env;
+14 -2
src-native/data_js.rs
··· 1 1 use crate::data::{Data, app_log_dir, path_to_string}; 2 2 use crate::library::Paths; 3 - use anyhow::Result; 4 - use napi::Env; 3 + use napi::{Env, Result}; 5 4 use std::fs; 5 + 6 + pub struct JsError(pub anyhow::Error); 7 + 8 + impl From<JsError> for napi::Error { 9 + fn from(err: JsError) -> Self { 10 + napi::Error::from_reason(format!("{:#}", err.0)) 11 + } 12 + } 13 + impl From<anyhow::Error> for JsError { 14 + fn from(err: anyhow::Error) -> Self { 15 + JsError(err) 16 + } 17 + } 6 18 7 19 pub fn get_data(env: &Env) -> &mut Data { 8 20 let data = env