globals.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Brawler
  3. *
  4. * Copyright 2019 Matthias Ladkau. All rights reserved.
  5. *
  6. * This Source Code Form is subject to the terms of the MIT
  7. * License, If a copy of the MIT License was not distributed with this
  8. * file, You can obtain one at https://opensource.org/licenses/MIT.
  9. */
  10. package rumble
  11. import (
  12. "errors"
  13. )
  14. /*
  15. Default variables for sinks
  16. */
  17. const (
  18. VarProcessor = "processor" // Current event processor (new sinks will be added to this)
  19. VarMonitor = "monitor" // Current event monitor (new events will be using this)
  20. VarEvent = "event" // Current event which triggered a sink
  21. )
  22. /*
  23. Runtime related error types - these errors are generic errors of Rumble
  24. where the code will not check for object equality
  25. */
  26. var (
  27. ErrInvalidConstruct = errors.New("Invalid construct")
  28. ErrInvalidState = errors.New("Invalid state")
  29. ErrVarAccess = errors.New("Cannot access variable")
  30. ErrNotANumber = errors.New("Operand is not a number")
  31. ErrNotABoolean = errors.New("Operand is not a boolean")
  32. ErrNotAList = errors.New("Operand is not a list")
  33. ErrNotAMap = errors.New("Operand is not a map")
  34. ErrNotAListOrMap = errors.New("Operand is not a list nor a map")
  35. )
  36. /*
  37. RuntimeError is a special error which contains additional internal
  38. information which are not exposed (e.g. code line).
  39. */
  40. type RuntimeError error