Skip to content

Commit

Permalink
Handle case that no access were found
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorPlatz committed Nov 28, 2023
1 parent 9cd009b commit f6b41ae
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api/ecdar_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ impl EcdarApi for ConcreteEcdarApi {
};
access_info_list.push(access_info);
}

if access_info_list.is_empty() {
return Err(Status::new(
Code::NotFound,
"No access found for given user",
));
}

Ok(Response::new(ListAccessInfoResponse { access_info_list }))
}
Err(error) => Err(Status::new(Code::Internal, error.to_string())),
Expand Down

0 comments on commit f6b41ae

Please sign in to comment.