error.rs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. pub type Result<T> = std::result::Result<T, Error>;
  2. #[repr(u8)]
  3. #[derive(Debug, Copy, Clone, thiserror::Error)]
  4. pub enum Error {
  5. #[error("Invalid scene path")]
  6. InvalidScenePath = 1,
  7. #[error("Node not found")]
  8. NodeNotFound = 2,
  9. #[error("Child node not found")]
  10. ChildNodeNotFound = 3,
  11. #[error("Parent node not found")]
  12. ParentNodeNotFound = 4,
  13. #[error("Property already exists")]
  14. PropertyAlreadyExists = 5,
  15. #[error("Property not found")]
  16. PropertyNotFound = 6,
  17. #[error("Property has wrong type")]
  18. PropertyWrongType = 7,
  19. #[error("Property has wrong subtype")]
  20. PropertyWrongSubType = 8,
  21. #[error("Property value has the wrong length")]
  22. PropertyWrongLen = 9,
  23. #[error("Property index is wrong")]
  24. PropertyWrongIndex = 10,
  25. #[error("Property out of range")]
  26. PropertyOutOfRange = 11,
  27. #[error("Property null not allowed")]
  28. PropertyNullNotAllowed = 12,
  29. #[error("Property S-exprs not allowed")]
  30. PropertySExprNotAllowed = 13,
  31. #[error("Property array is bounded length")]
  32. PropertyIsBounded = 14,
  33. #[error("Property enum item is invalid")]
  34. PropertyWrongEnumItem = 15,
  35. #[error("Signal already exists")]
  36. SignalAlreadyExists = 16,
  37. #[error("Signal not found")]
  38. SignalNotFound = 17,
  39. #[error("Slot not found")]
  40. SlotNotFound = 18,
  41. #[error("Signal already exists")]
  42. MethodAlreadyExists = 19,
  43. #[error("Method not found")]
  44. MethodNotFound = 20,
  45. #[error("Nodes are not linked")]
  46. NodesAreLinked = 21,
  47. #[error("Nodes are not linked")]
  48. NodesNotLinked = 22,
  49. #[error("Node has parents")]
  50. NodeHasParents = 23,
  51. #[error("Node has children")]
  52. NodeHasChildren = 24,
  53. #[error("Node has a parent with this name")]
  54. NodeParentNameConflict = 25,
  55. #[error("Node has a child with this name")]
  56. NodeChildNameConflict = 26,
  57. #[error("Node has a sibling with this name")]
  58. NodeSiblingNameConflict = 27,
  59. #[error("File not found")]
  60. FileNotFound = 28,
  61. #[error("Resource is not found")]
  62. ResourceNotFound = 29,
  63. #[error("Python expr eval error")]
  64. PyEvalErr = 30,
  65. #[error("Empty S-expr")]
  66. SExprEmpty = 31,
  67. #[error("S-expr global not found")]
  68. SExprGlobalNotFound = 32,
  69. }