1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use thiserror::Error;

// type BoxedSyncSendError = Box<dyn std::error::Error + Sync + std::marker::Send>;

/// Error type for the flow expression parser.
#[derive(Error, Debug, Clone, PartialEq)]
pub enum ParserError {
  /// Component id is not a fully qualified name with a namespace.
  #[error("Component id '{0}' is not a fully qualified name with a namespace")]
  ComponentIdError(String),

  /// General deserialization error.
  #[error("Failed to deserialize configuration {0}")]
  ConfigurationDeserialization(String),

  /// Error deserializing YAML manifest.
  #[error("Could not parse manifest as YAML: {0}")]
  YamlError(String),

  /// Default was requested when none present.
  #[error("Invalid connection target syntax: '{0}'")]
  ConnectionTargetSyntax(String),

  /// Default was requested when none present.
  #[error("Invalid connection definition syntax: '{0}'")]
  ConnectionDefinitionSyntax(String),

  /// Ambiguous reference in connection shorthand.
  #[error("No suitable default found for port in : {0}")]
  NoDefaultPort(String),

  /// Ambiguous port in connection shorthand.
  #[error("No suitable default found for reference in : {0}")]
  NoDefaultReference(String),

  /// Error parsing or serializing Sender data.
  #[error("Error parsing or serializing Sender data: {0}")]
  InvalidSenderData(String),

  /// Error attempting to get details of a target that doesn't exist.
  #[error("Attempted to grab data from a target that doesn't exist")]
  NoTarget,

  /// File path in manifest is invalid.
  #[error("Invalid file path: {0}")]
  BadPath(String),

  /// IP address in manifest is invalid.
  #[error("Invalid IP Address: {0}")]
  BadIpAddress(String),

  /// Miscellaneous error.
  #[error("General error : {0}")]
  Other(String),
}