aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-02 17:32:43 +0900
committernsfisis <nsfisis@gmail.com>2026-08-02 17:32:43 +0900
commit7e31bab9ff7209c9b6d7928a581d7a449846f42e (patch)
treeb121966a169ee74afe04d066576e862a6702bbf6 /crates/shirabe/src
parentebcb4a7f013c0511dd6617686395cef17822d1e2 (diff)
downloadphp-shirabe-7e31bab9ff7209c9b6d7928a581d7a449846f42e.tar.gz
php-shirabe-7e31bab9ff7209c9b6d7928a581d7a449846f42e.tar.zst
php-shirabe-7e31bab9ff7209c9b6d7928a581d7a449846f42e.zip
fix(json): propagate JsonFile::encode errors instead of unwrapping
PHP's JsonFile::encode throws a RuntimeException when json_encode fails; the port swallowed that into an .unwrap() marked TODO(phase-c). Return anyhow::Result from encode/encode_with_options and propagate at every call site (print_table and list_repositories become Result-returning to carry it). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src')
-rw-r--r--crates/shirabe/src/advisory/auditor.rs2
-rw-r--r--crates/shirabe/src/command/check_platform_reqs_command.rs8
-rw-r--r--crates/shirabe/src/command/config_command.rs2
-rw-r--r--crates/shirabe/src/command/fund_command.rs2
-rw-r--r--crates/shirabe/src/command/init_command.rs2
-rw-r--r--crates/shirabe/src/command/licenses_command.rs2
-rw-r--r--crates/shirabe/src/command/repository_command.rs15
-rw-r--r--crates/shirabe/src/command/search_command.rs2
-rw-r--r--crates/shirabe/src/command/show_command.rs8
-rw-r--r--crates/shirabe/src/factory.rs2
-rw-r--r--crates/shirabe/src/json/json_file.rs24
-rw-r--r--crates/shirabe/src/json/json_manipulator.rs74
-rw-r--r--crates/shirabe/src/package/locker.rs4
-rw-r--r--crates/shirabe/src/repository/composer_repository.rs6
-rw-r--r--crates/shirabe/src/repository/vcs/forgejo_driver.rs2
-rw-r--r--crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs2
-rw-r--r--crates/shirabe/src/repository/vcs/github_driver.rs2
-rw-r--r--crates/shirabe/src/repository/vcs/gitlab_driver.rs2
-rw-r--r--crates/shirabe/src/repository/vcs/svn_driver.rs2
-rw-r--r--crates/shirabe/src/repository/vcs/vcs_driver.rs4
20 files changed, 89 insertions, 78 deletions
diff --git a/crates/shirabe/src/advisory/auditor.rs b/crates/shirabe/src/advisory/auditor.rs
index e0bb374c..853fa36f 100644
--- a/crates/shirabe/src/advisory/auditor.rs
+++ b/crates/shirabe/src/advisory/auditor.rs
@@ -189,7 +189,7 @@ impl Auditor {
abandoned,
};
- io.write(&JsonFile::encode(&report));
+ io.write(&JsonFile::encode(&report)?);
return Ok(audit_bitmask);
}
diff --git a/crates/shirabe/src/command/check_platform_reqs_command.rs b/crates/shirabe/src/command/check_platform_reqs_command.rs
index 088c9407..903e0c4c 100644
--- a/crates/shirabe/src/command/check_platform_reqs_command.rs
+++ b/crates/shirabe/src/command/check_platform_reqs_command.rs
@@ -59,7 +59,7 @@ impl CheckPlatformReqsCommand {
output: std::rc::Rc<std::cell::RefCell<dyn OutputInterface>>,
results: &[CheckResult],
format: &str,
- ) {
+ ) -> anyhow::Result<()> {
let io = self.get_io();
if format == "json" {
@@ -117,7 +117,7 @@ impl CheckPlatformReqsCommand {
})
.collect();
- io.write(&JsonFile::encode(&PhpMixed::List(rows)));
+ io.write(&JsonFile::encode(&PhpMixed::List(rows))?);
} else {
let rows: Vec<PhpMixed> = results
.iter()
@@ -151,6 +151,8 @@ impl CheckPlatformReqsCommand {
self.render_table(rows, output);
}
+
+ Ok(())
}
}
@@ -396,7 +398,7 @@ impl Command for CheckPlatformReqsCommand {
.as_string()
.unwrap_or("text")
.to_string();
- self.print_table(_output, &results, &format);
+ self.print_table(_output, &results, &format)?;
Ok(exit_code)
}
diff --git a/crates/shirabe/src/command/config_command.rs b/crates/shirabe/src/command/config_command.rs
index 0b22757a..7e8b82e9 100644
--- a/crates/shirabe/src/command/config_command.rs
+++ b/crates/shirabe/src/command/config_command.rs
@@ -497,7 +497,7 @@ impl Command for ConfigCommand {
pretty_print: false,
..Default::default()
},
- )
+ )?
} else {
value.as_string().unwrap_or("").to_string()
};
diff --git a/crates/shirabe/src/command/fund_command.rs b/crates/shirabe/src/command/fund_command.rs
index bf5e281a..8ea566dc 100644
--- a/crates/shirabe/src/command/fund_command.rs
+++ b/crates/shirabe/src/command/fund_command.rs
@@ -211,7 +211,7 @@ impl Command for FundCommand {
io.write("Thank you!");
} else if format == "json" {
let fundings_mixed: PhpMixed = fundings.clone().into();
- io.write(&JsonFile::encode(&fundings_mixed));
+ io.write(&JsonFile::encode(&fundings_mixed)?);
} else {
io.write("No funding links were found in your package dependencies. This doesn't mean they don't need your support!");
}
diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs
index ec3f38b5..6923f768 100644
--- a/crates/shirabe/src/command/init_command.rs
+++ b/crates/shirabe/src/command/init_command.rs
@@ -290,7 +290,7 @@ impl Command for InitCommand {
let file_obj = JsonFile::new(Factory::get_composer_file()?, None, None)?;
let options_for_encode: IndexMap<String, PhpMixed> = options.clone().into_iter().collect();
- let json = JsonFile::encode(&PhpMixed::Array(options_for_encode.clone()));
+ let json = JsonFile::encode(&PhpMixed::Array(options_for_encode.clone()))?;
if input.borrow().is_interactive() {
io.write_error3(&format!("\n{}\n", json), true, io_interface::NORMAL);
diff --git a/crates/shirabe/src/command/licenses_command.rs b/crates/shirabe/src/command/licenses_command.rs
index 002bce89..41e9ba90 100644
--- a/crates/shirabe/src/command/licenses_command.rs
+++ b/crates/shirabe/src/command/licenses_command.rs
@@ -273,7 +273,7 @@ impl Command for LicensesCommand {
output_map.insert("dependencies".to_string(), PhpMixed::Array(dependencies));
io.write(&JsonFile::encode(&PhpMixed::Array(
output_map.into_iter().collect(),
- )));
+ ))?);
}
"summary" => {
let mut used_licenses: IndexMap<String, i64> = IndexMap::new();
diff --git a/crates/shirabe/src/command/repository_command.rs b/crates/shirabe/src/command/repository_command.rs
index 31d2de3f..d23e114c 100644
--- a/crates/shirabe/src/command/repository_command.rs
+++ b/crates/shirabe/src/command/repository_command.rs
@@ -50,7 +50,7 @@ impl RepositoryCommand {
command
}
- fn list_repositories(&self, mut repos: IndexMap<String, PhpMixed>) {
+ fn list_repositories(&self, mut repos: IndexMap<String, PhpMixed>) -> anyhow::Result<()> {
let io = self.get_io();
let mut packagist_present = false;
@@ -84,7 +84,7 @@ impl RepositoryCommand {
if repos.is_empty() {
io.write("No repositories configured");
- return;
+ return Ok(());
}
for (key, repo) in &repos {
@@ -111,14 +111,19 @@ impl RepositoryCommand {
.get("type")
.and_then(|v| v.as_string())
.unwrap_or("unknown");
- let url = repo_map
+ let url = match repo_map
.get("url")
.and_then(|v| v.as_string())
.map(|s| s.to_string())
- .unwrap_or_else(|| JsonFile::encode(repo));
+ {
+ Some(url) => url,
+ None => JsonFile::encode(repo)?,
+ };
io.write(&format!("[{}] <info>{}</info> {}", name, r#type, url));
}
}
+
+ Ok(())
}
/// PHP: private function suggestTypeForAdd(): \Closure (a static closure — `this` unused)
@@ -352,7 +357,7 @@ impl Command for RepositoryCommand {
match action.as_str() {
"list" | "ls" | "show" => {
- self.list_repositories(repos);
+ self.list_repositories(repos)?;
Ok(0)
}
"add" => {
diff --git a/crates/shirabe/src/command/search_command.rs b/crates/shirabe/src/command/search_command.rs
index 2e0f95da..b0eabf80 100644
--- a/crates/shirabe/src/command/search_command.rs
+++ b/crates/shirabe/src/command/search_command.rs
@@ -293,7 +293,7 @@ impl Command for SearchCommand {
PhpMixed::Array(entry)
})
.collect();
- io.write(&JsonFile::encode(&PhpMixed::List(rows)));
+ io.write(&JsonFile::encode(&PhpMixed::List(rows))?);
}
Ok(0)
diff --git a/crates/shirabe/src/command/show_command.rs b/crates/shirabe/src/command/show_command.rs
index 4cc0c204..a3bf7157 100644
--- a/crates/shirabe/src/command/show_command.rs
+++ b/crates/shirabe/src/command/show_command.rs
@@ -698,7 +698,7 @@ impl Command for ShowCommand {
);
self.get_io().write(&JsonFile::encode(&PhpMixed::Array(
wrapper.into_iter().collect(),
- )));
+ ))?);
} else {
self.display_package_tree(vec![array_tree]);
}
@@ -829,7 +829,7 @@ impl Command for ShowCommand {
);
self.get_io().write(&JsonFile::encode(&PhpMixed::Array(
wrapper.into_iter().collect(),
- )));
+ ))?);
} else {
self.display_package_tree(array_tree);
}
@@ -1289,7 +1289,7 @@ impl Command for ShowCommand {
let io = self.get_io();
io.write(&JsonFile::encode(&PhpMixed::Array(
json_map.into_iter().collect(),
- )));
+ ))?);
} else {
if input.borrow().get_option("latest")?.as_bool() == Some(true)
&& view_data.values().any(|v| !v.is_empty())
@@ -2222,7 +2222,7 @@ impl ShowCommand {
self.get_io().write(&JsonFile::encode(&PhpMixed::Array(
json.into_iter().collect(),
- )));
+ ))?);
Ok(())
}
diff --git a/crates/shirabe/src/factory.rs b/crates/shirabe/src/factory.rs
index 98fba740..b5f96cc3 100644
--- a/crates/shirabe/src/factory.rs
+++ b/crates/shirabe/src/factory.rs
@@ -790,7 +790,7 @@ impl Factory {
.iter()
.map(|(k, v)| (k.clone(), v.clone()))
.collect(),
- ));
+ ))?;
let locker = Locker::new(
io.clone(),
JsonFile::new(Platform::get_dev_null(), None, Some(io.clone()))?,
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs
index cba11f01..632519a7 100644
--- a/crates/shirabe/src/json/json_file.rs
+++ b/crates/shirabe/src/json/json_file.rs
@@ -220,7 +220,7 @@ impl JsonFile {
if self.path == "php://memory" {
file_put_contents(
&self.path,
- Self::encode_with_options(&hash, options).as_bytes(),
+ Self::encode_with_options(&hash, options)?.as_bytes(),
);
return Ok(());
@@ -256,7 +256,7 @@ impl JsonFile {
&self.path,
&format!(
"{}{}",
- Self::encode_with_options(&hash, options.clone()),
+ Self::encode_with_options(&hash, options.clone())?,
if options.pretty_print { "\n" } else { "" },
),
)?;
@@ -443,25 +443,23 @@ impl JsonFile {
Ok(true)
}
- pub fn encode<T: serde::Serialize + ?Sized>(data: &T) -> String {
+ pub fn encode<T: serde::Serialize + ?Sized>(data: &T) -> anyhow::Result<String> {
Self::encode_with_options(data, JsonEncodeOptions::default())
}
pub fn encode_with_options<T: serde::Serialize + ?Sized>(
data: &T,
options: JsonEncodeOptions,
- ) -> String {
- let json = json_encode_ex(data, options.to_flags())
- .map_err(|err| RuntimeException {
- message: format!("JSON encoding failed: {}", err),
- code: 0,
- })
- .unwrap(); // TODO(phase-c): propagating an Err.
+ ) -> anyhow::Result<String> {
+ let json = json_encode_ex(data, options.to_flags()).map_err(|err| RuntimeException {
+ message: format!("JSON encoding failed: {}", err),
+ code: 0,
+ })?;
if options.pretty_print && options.indent != Self::INDENT_DEFAULT {
// Pretty printing and not using default indentation
let indent_owned = options.indent;
- return Preg::replace_callback(
+ return Ok(Preg::replace_callback(
php_regex!(r"#^ {4,}#m"),
move |m: &indexmap::IndexMap<
shirabe_external_packages::composer::pcre::CaptureKey,
@@ -475,10 +473,10 @@ impl JsonFile {
str_repeat(&indent_owned, (strlen(whole) / 4) as usize)
},
&json,
- );
+ ));
}
- json
+ Ok(json)
}
/// Parses json string and returns hash.
diff --git a/crates/shirabe/src/json/json_manipulator.rs b/crates/shirabe/src/json/json_manipulator.rs
index 3647e846..48500de2 100644
--- a/crates/shirabe/src/json/json_manipulator.rs
+++ b/crates/shirabe/src/json/json_manipulator.rs
@@ -85,7 +85,7 @@ impl JsonManipulator {
let m = match json_grammar::find_top_level_key(
self.contents.as_bytes(),
- JsonFile::encode(r#type).as_bytes(),
+ JsonFile::encode(r#type)?.as_bytes(),
ValueKind::Json,
) {
Some(m) => m,
@@ -107,7 +107,7 @@ impl JsonManipulator {
links = format!(
"{}{}{}\"{}\"{}",
&links[..key_start],
- JsonFile::encode(&str_replace("\\/", "/", &existing_package)),
+ JsonFile::encode(&str_replace("\\/", "/", &existing_package))?,
separator,
constraint,
&links[value_end..]
@@ -133,8 +133,8 @@ impl JsonManipulator {
self.newline,
self.indent,
self.indent,
- JsonFile::encode(package),
- JsonFile::encode(constraint),
+ JsonFile::encode(package)?,
+ JsonFile::encode(constraint)?,
groups_1
),
"\\$",
@@ -148,8 +148,8 @@ impl JsonManipulator {
self.newline,
self.indent,
self.indent,
- JsonFile::encode(package),
- JsonFile::encode(constraint),
+ JsonFile::encode(package)?,
+ JsonFile::encode(constraint)?,
self.newline,
self.indent
);
@@ -375,22 +375,28 @@ impl JsonManipulator {
Some((i, e))
})
} else {
- json_grammar::find_top_level_key(
- self.contents.as_bytes(),
- b"\"repositories\"",
- ValueKind::Object,
- )
- .and_then(|reps| {
- let obj = self.contents[reps.value_pos..reps.value_end].to_string();
- let key = JsonFile::encode(&repository_index);
- json_grammar::find_top_level_key(obj.as_bytes(), key.as_bytes(), ValueKind::Object)
+ {
+ let key = JsonFile::encode(&repository_index)?;
+ json_grammar::find_top_level_key(
+ self.contents.as_bytes(),
+ b"\"repositories\"",
+ ValueKind::Object,
+ )
+ .and_then(|reps| {
+ let obj = self.contents[reps.value_pos..reps.value_end].to_string();
+ json_grammar::find_top_level_key(
+ obj.as_bytes(),
+ key.as_bytes(),
+ ValueKind::Object,
+ )
.map(|inner| {
(
reps.value_pos + inner.value_pos,
reps.value_pos + inner.value_end,
)
})
- })
+ })
+ }
};
let (repo_pos, repo_end) = match repo_span {
@@ -416,7 +422,7 @@ impl JsonManipulator {
Some(u) => format!(
"{}{}{}",
&raw_repo[..u.value_pos],
- JsonFile::encode(url),
+ JsonFile::encode(url)?,
&raw_repo[u.value_end..]
),
None => raw_repo,
@@ -692,7 +698,7 @@ impl JsonManipulator {
// main node content not match-able
let node = match json_grammar::find_top_level_key(
self.contents.as_bytes(),
- JsonFile::encode(main_node).as_bytes(),
+ JsonFile::encode(main_node)?.as_bytes(),
ValueKind::Object,
) {
Some(node) => node,
@@ -771,7 +777,7 @@ impl JsonManipulator {
self.newline,
self.indent,
self.indent,
- JsonFile::encode(&name_owned),
+ JsonFile::encode(&name_owned)?,
self.format(&value_local, 1, false)?,
whitespace
),
@@ -787,7 +793,7 @@ impl JsonManipulator {
&format!(
"{{{}{}: {},{}{}{}",
whitespace,
- JsonFile::encode(&name_owned),
+ JsonFile::encode(&name_owned)?,
self.format(&value_local, 1, false)?,
self.newline,
self.indent,
@@ -812,7 +818,7 @@ impl JsonManipulator {
self.newline,
self.indent,
self.indent,
- JsonFile::encode(&name_owned),
+ JsonFile::encode(&name_owned)?,
self.format(&value_local, 1, false)?,
whitespace
);
@@ -843,7 +849,7 @@ impl JsonManipulator {
// no node content match-able
let node = match json_grammar::find_top_level_key(
self.contents.as_bytes(),
- JsonFile::encode(main_node).as_bytes(),
+ JsonFile::encode(main_node)?.as_bytes(),
ValueKind::Object,
) {
Some(node) => node,
@@ -1025,7 +1031,7 @@ impl JsonManipulator {
// main node content not match-able
let node = match json_grammar::find_top_level_key(
self.contents.as_bytes(),
- JsonFile::encode(main_node).as_bytes(),
+ JsonFile::encode(main_node)?.as_bytes(),
ValueKind::Array,
) {
Some(node) => node,
@@ -1161,7 +1167,7 @@ impl JsonManipulator {
// main node content not match-able
let node = match json_grammar::find_top_level_key(
self.contents.as_bytes(),
- JsonFile::encode(main_node).as_bytes(),
+ JsonFile::encode(main_node)?.as_bytes(),
ValueKind::Array,
) {
Some(node) => node,
@@ -1225,7 +1231,7 @@ impl JsonManipulator {
// no node content match-able
let node = match json_grammar::find_top_level_key(
self.contents.as_bytes(),
- JsonFile::encode(main_node).as_bytes(),
+ JsonFile::encode(main_node)?.as_bytes(),
ValueKind::Array,
) {
Some(node) => node,
@@ -1304,7 +1310,7 @@ impl JsonManipulator {
let content = self.format(&content, 0, false)?;
// key exists already
- let encoded_key = JsonFile::encode(key);
+ let encoded_key = JsonFile::encode(key)?;
let key_match = if decoded.as_array().and_then(|a| a.get(key)).is_some() {
json_grammar::find_top_level_key(
self.contents.as_bytes(),
@@ -1350,7 +1356,7 @@ impl JsonManipulator {
",{}{}{}: {}{}}}",
self.newline,
self.indent,
- JsonFile::encode(key),
+ JsonFile::encode(key)?,
content,
self.newline
),
@@ -1369,7 +1375,7 @@ impl JsonManipulator {
&format!(
"{}{}: {}{}}}",
self.indent,
- JsonFile::encode(key),
+ JsonFile::encode(key)?,
content,
self.newline
),
@@ -1390,7 +1396,7 @@ impl JsonManipulator {
}
// key exists already
- let encoded_key = JsonFile::encode(key);
+ let encoded_key = JsonFile::encode(key)?;
let key_match = json_grammar::find_top_level_key(
self.contents.as_bytes(),
encoded_key.as_bytes(),
@@ -1443,7 +1449,7 @@ impl JsonManipulator {
}
// Match the key only when its value is an empty object `{ <space> }`.
- let encoded_key = JsonFile::encode(key);
+ let encoded_key = JsonFile::encode(key)?;
let cb = self.contents.as_bytes();
let key_match =
json_grammar::find_top_level_key(cb, encoded_key.as_bytes(), ValueKind::Object)
@@ -1531,7 +1537,7 @@ impl JsonManipulator {
elems.push(format!(
"{}{}: {}",
str_repeat(&self.indent, (depth + 2) as usize),
- JsonFile::encode(key),
+ JsonFile::encode(key)?,
self.format(val, depth + 1, false)?
));
}
@@ -1546,7 +1552,7 @@ impl JsonManipulator {
));
}
- Ok(JsonFile::encode(&data))
+ JsonFile::encode(&data)
}
pub(crate) fn detect_indenting(&mut self) {
@@ -1707,7 +1713,7 @@ impl ManipulatorFormatter {
elems.push(format!(
"{}{}: {}",
str_repeat(&self.indent, (depth + 2) as usize),
- JsonFile::encode(key),
+ JsonFile::encode(key)?,
self.format(val, depth + 1, false)?
));
}
@@ -1722,6 +1728,6 @@ impl ManipulatorFormatter {
));
}
- Ok(JsonFile::encode(&data))
+ JsonFile::encode(&data)
}
}
diff --git a/crates/shirabe/src/package/locker.rs b/crates/shirabe/src/package/locker.rs
index 02cbfa4a..b7d8ba7a 100644
--- a/crates/shirabe/src/package/locker.rs
+++ b/crates/shirabe/src/package/locker.rs
@@ -132,7 +132,7 @@ impl Locker {
&JsonFile::encode_with_options(
&PhpMixed::Array(relevant_content.into_iter().collect()),
JsonEncodeOptions::none(),
- ),
+ )?,
))
}
@@ -620,7 +620,7 @@ impl Locker {
let parsed = JsonFile::parse_json(
Some(&JsonFile::encode(&PhpMixed::Array(
lock.into_iter().collect(),
- ))),
+ ))?),
None,
)?;
let parsed_map: IndexMap<String, PhpMixed> = match parsed {
diff --git a/crates/shirabe/src/repository/composer_repository.rs b/crates/shirabe/src/repository/composer_repository.rs
index 015a278e..c15c6e12 100644
--- a/crates/shirabe/src/repository/composer_repository.rs
+++ b/crates/shirabe/src/repository/composer_repository.rs
@@ -2874,7 +2874,7 @@ impl ComposerRepository {
.map(|(k, v)| (k.clone(), v.clone()))
.collect(),
);
- json = JsonFile::encode_with_options(&as_mixed, JsonEncodeOptions::none());
+ json = JsonFile::encode_with_options(&as_mixed, JsonEncodeOptions::none())?;
}
self.cache.borrow_mut().write(ck, &json);
}
@@ -3054,7 +3054,7 @@ impl ComposerRepository {
data.insert("last-modified".to_string(), PhpMixed::String(lmd.clone()));
let as_mixed =
PhpMixed::Array(data.iter().map(|(k, v)| (k.clone(), v.clone())).collect());
- json = JsonFile::encode_with_options(&as_mixed, JsonEncodeOptions::none());
+ json = JsonFile::encode_with_options(&as_mixed, JsonEncodeOptions::none())?;
}
if !self.cache.borrow().is_read_only() {
self.cache.borrow_mut().write(cache_key, &json);
@@ -3229,7 +3229,7 @@ impl ComposerRepository {
pretty_print: false,
..Default::default()
},
- );
+ )?;
}
if !self.cache.borrow().is_read_only() {
self.cache.borrow_mut().write(cache_key, &json);
diff --git a/crates/shirabe/src/repository/vcs/forgejo_driver.rs b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
index 49d0dcf1..0719701f 100644
--- a/crates/shirabe/src/repository/vcs/forgejo_driver.rs
+++ b/crates/shirabe/src/repository/vcs/forgejo_driver.rs
@@ -364,7 +364,7 @@ impl ForgejoDriver {
pretty_print: false,
..Default::default()
},
- );
+ )?;
self.inner
.cache
.as_mut()
diff --git a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
index 95d29938..394077e9 100644
--- a/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
+++ b/crates/shirabe/src/repository/vcs/git_bitbucket_driver.rs
@@ -281,7 +281,7 @@ impl GitBitbucketDriver {
pretty_print: false,
..Default::default()
},
- ),
+ )?,
)?;
}
}
diff --git a/crates/shirabe/src/repository/vcs/github_driver.rs b/crates/shirabe/src/repository/vcs/github_driver.rs
index c7fe5266..8134a16b 100644
--- a/crates/shirabe/src/repository/vcs/github_driver.rs
+++ b/crates/shirabe/src/repository/vcs/github_driver.rs
@@ -303,7 +303,7 @@ impl GitHubDriver {
pretty_print: false,
..Default::default()
},
- ),
+ )?,
)
});
}
diff --git a/crates/shirabe/src/repository/vcs/gitlab_driver.rs b/crates/shirabe/src/repository/vcs/gitlab_driver.rs
index 8d100755..9a4c22a1 100644
--- a/crates/shirabe/src/repository/vcs/gitlab_driver.rs
+++ b/crates/shirabe/src/repository/vcs/gitlab_driver.rs
@@ -298,7 +298,7 @@ impl GitLabDriver {
pretty_print: false,
..Default::default()
},
- ),
+ )?,
)
});
}
diff --git a/crates/shirabe/src/repository/vcs/svn_driver.rs b/crates/shirabe/src/repository/vcs/svn_driver.rs
index 3c233db8..716b1943 100644
--- a/crates/shirabe/src/repository/vcs/svn_driver.rs
+++ b/crates/shirabe/src/repository/vcs/svn_driver.rs
@@ -227,7 +227,7 @@ impl SvnDriver {
pretty_print: false,
..Default::default()
},
- );
+ )?;
self.inner
.cache
.as_mut()
diff --git a/crates/shirabe/src/repository/vcs/vcs_driver.rs b/crates/shirabe/src/repository/vcs/vcs_driver.rs
index 5aa74959..3321201c 100644
--- a/crates/shirabe/src/repository/vcs/vcs_driver.rs
+++ b/crates/shirabe/src/repository/vcs/vcs_driver.rs
@@ -171,7 +171,7 @@ impl VcsDriverBase {
pretty_print: false,
..Default::default()
},
- );
+ )?;
self.cache.as_mut().map(|c| c.write(identifier, &encoded));
}
self.info_cache.insert(identifier.to_string(), composer);
@@ -237,7 +237,7 @@ pub trait VcsDriver: VcsDriverInterface {
pretty_print: false,
..Default::default()
},
- );
+ )?;
self.cache_mut().map(|c| c.write(identifier, &encoded));
}