Skip to content

Commit

Permalink
fix: error message for override file API (#1505)
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed Jul 17, 2024
1 parent 7a22b93 commit cf32bb2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kclvm/api/src/service/service_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,17 +584,17 @@ impl KclvmServiceImpl {
/// age = 18
/// }
/// ```
pub fn override_file(&self, args: &OverrideFileArgs) -> Result<OverrideFileResult, String> {
override_file(&args.file, &args.specs, &args.import_paths)
.map_err(|err| err.to_string())
.map(|result| OverrideFileResult {
pub fn override_file(&self, args: &OverrideFileArgs) -> anyhow::Result<OverrideFileResult> {
override_file(&args.file, &args.specs, &args.import_paths).map(|result| {
OverrideFileResult {
result: result.result,
parse_errors: result
.parse_errors
.into_iter()
.map(|e| e.into_error())
.collect(),
})
}
})
}

/// Service for getting the schema mapping.
Expand Down

0 comments on commit cf32bb2

Please sign in to comment.