mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 14:34:34 +03:00
improve error messages for mapping length errors
Summary: Make it clear which error is which, and what the number of expected and actual items are. Reviewed By: StanislavGlebik Differential Revision: D23813369 fbshipit-source-id: 5b94c5a67438c475235876669ec2be3fd1866700
This commit is contained in:
parent
5d8357a30a
commit
b6a6882d10
@ -5,7 +5,7 @@
|
|||||||
* GNU General Public License version 2.
|
* GNU General Public License version 2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::{anyhow, Error};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use bookmarks::BookmarkTransactionError;
|
use bookmarks::BookmarkTransactionError;
|
||||||
use context::CoreContext;
|
use context::CoreContext;
|
||||||
@ -97,8 +97,10 @@ impl PushrebaseCommitHook for GitMappingCommitHook {
|
|||||||
// NOTE: This check shouldn't be necessary as long as pushrebase hooks are bug-free, but
|
// NOTE: This check shouldn't be necessary as long as pushrebase hooks are bug-free, but
|
||||||
// since they're a new addition, let's be conservative.
|
// since they're a new addition, let's be conservative.
|
||||||
if rebased.len() != self.assignments.len() {
|
if rebased.len() != self.assignments.len() {
|
||||||
return Err(Error::msg(
|
return Err(anyhow!(
|
||||||
"Rebased set and assignments have different lengths!",
|
"Git mapping rebased set ({}) and assignments ({}) have different lengths!",
|
||||||
|
rebased.len(),
|
||||||
|
self.assignments.len(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* GNU General Public License version 2.
|
* GNU General Public License version 2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use anyhow::Error;
|
use anyhow::{anyhow, Error};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use bookmarks::BookmarkTransactionError;
|
use bookmarks::BookmarkTransactionError;
|
||||||
use context::CoreContext;
|
use context::CoreContext;
|
||||||
@ -124,8 +124,10 @@ impl PushrebaseCommitHook for GlobalrevCommitHook {
|
|||||||
// NOTE: This check shouldn't be necessary as long as pushrebase hooks are bug-free, but
|
// NOTE: This check shouldn't be necessary as long as pushrebase hooks are bug-free, but
|
||||||
// since they're a new addition, let's be conservative.
|
// since they're a new addition, let's be conservative.
|
||||||
if rebased.len() != self.assignments.len() {
|
if rebased.len() != self.assignments.len() {
|
||||||
return Err(Error::msg(
|
return Err(anyhow!(
|
||||||
"Rebased set and assignments have different lengths!",
|
"Globalrev rebased set ({}) and assignments ({}) have different lengths!",
|
||||||
|
rebased.len(),
|
||||||
|
self.assignments.len(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user