fix(error): prefix internal errors with "Internal: "
This commit is contained in:
@@ -14,7 +14,7 @@ impl PulseSender {
|
|||||||
pub fn add_to(node: &RcCell<Node>) -> Result<()> {
|
pub fn add_to(node: &RcCell<Node>) -> Result<()> {
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().spatial.is_some(),
|
node.borrow().spatial.is_some(),
|
||||||
"Node does not have a spatial attached!"
|
"Internal: Node does not have a spatial attached!"
|
||||||
);
|
);
|
||||||
|
|
||||||
let sender = PulseSender {};
|
let sender = PulseSender {};
|
||||||
|
|||||||
@@ -157,11 +157,11 @@ impl BoxField {
|
|||||||
pub fn add_to(node: &RcCell<Node>, size: Vec3) -> Result<()> {
|
pub fn add_to(node: &RcCell<Node>, size: Vec3) -> Result<()> {
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().spatial.is_some(),
|
node.borrow().spatial.is_some(),
|
||||||
"Node does not have a spatial attached!"
|
"Internal: Node does not have a spatial attached!"
|
||||||
);
|
);
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().field.is_none(),
|
node.borrow().field.is_none(),
|
||||||
"Node already has a field attached!"
|
"Internal: Node already has a field attached!"
|
||||||
);
|
);
|
||||||
let box_field = BoxField {
|
let box_field = BoxField {
|
||||||
space: node.borrow().spatial.as_ref().unwrap().clone(),
|
space: node.borrow().spatial.as_ref().unwrap().clone(),
|
||||||
@@ -218,11 +218,11 @@ impl CylinderField {
|
|||||||
pub fn add_to(node: &RcCell<Node>, length: f32, radius: f32) -> Result<()> {
|
pub fn add_to(node: &RcCell<Node>, length: f32, radius: f32) -> Result<()> {
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().spatial.is_some(),
|
node.borrow().spatial.is_some(),
|
||||||
"Node does not have a spatial attached!"
|
"Internal: Node does not have a spatial attached!"
|
||||||
);
|
);
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().field.is_none(),
|
node.borrow().field.is_none(),
|
||||||
"Node already has a field attached!"
|
"Internal: Node already has a field attached!"
|
||||||
);
|
);
|
||||||
let cylinder_field = CylinderField {
|
let cylinder_field = CylinderField {
|
||||||
space: node.borrow().spatial.as_ref().unwrap().clone(),
|
space: node.borrow().spatial.as_ref().unwrap().clone(),
|
||||||
@@ -285,11 +285,11 @@ impl SphereField {
|
|||||||
pub fn add_to(node: &RcCell<Node>, radius: f32) -> Result<()> {
|
pub fn add_to(node: &RcCell<Node>, radius: f32) -> Result<()> {
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().spatial.is_some(),
|
node.borrow().spatial.is_some(),
|
||||||
"Node does not have a spatial attached!"
|
"Internal: Node does not have a spatial attached!"
|
||||||
);
|
);
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow().field.is_none(),
|
node.borrow().field.is_none(),
|
||||||
"Node already has a field attached!"
|
"Internal: Node already has a field attached!"
|
||||||
);
|
);
|
||||||
let sphere_field = SphereField {
|
let sphere_field = SphereField {
|
||||||
space: node.borrow().spatial.as_ref().unwrap().clone(),
|
space: node.borrow().spatial.as_ref().unwrap().clone(),
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ impl Spatial {
|
|||||||
) -> Result<Rc<Spatial>> {
|
) -> Result<Rc<Spatial>> {
|
||||||
ensure!(
|
ensure!(
|
||||||
node.borrow_mut().spatial.is_none(),
|
node.borrow_mut().spatial.is_none(),
|
||||||
"Node already has a Spatial aspect!"
|
"Internal: Node already has a Spatial aspect!"
|
||||||
);
|
);
|
||||||
let spatial = Spatial {
|
let spatial = Spatial {
|
||||||
// node: node.downgrade(),
|
// node: node.downgrade(),
|
||||||
|
|||||||
Reference in New Issue
Block a user