QueryException.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------
  4. namespace System.ServiceModel.Dispatcher
  5. {
  6. using System;
  7. using System.Xml;
  8. using System.Xml.XPath;
  9. internal enum QueryProcessingError
  10. {
  11. None,
  12. Unexpected,
  13. TypeMismatch,
  14. UnsupportedXmlNodeType,
  15. NodeCountMaxExceeded,
  16. InvalidXmlAttributes,
  17. InvalidNavigatorPosition,
  18. NotAtomized,
  19. NotSupported,
  20. InvalidBodyAccess,
  21. InvalidNamespacePrefix
  22. }
  23. internal class QueryProcessingException : XPathException
  24. {
  25. QueryProcessingError error;
  26. internal QueryProcessingException(QueryProcessingError error, string message) : base(message, null)
  27. {
  28. this.error = error;
  29. }
  30. internal QueryProcessingException(QueryProcessingError error) : this(error, null)
  31. {
  32. this.error = error;
  33. }
  34. public override string ToString()
  35. {
  36. return this.error.ToString();
  37. }
  38. }
  39. internal enum QueryCompileError
  40. {
  41. None,
  42. General,
  43. CouldNotParseExpression,
  44. UnexpectedToken,
  45. UnsupportedOperator,
  46. UnsupportedAxis,
  47. UnsupportedFunction,
  48. UnsupportedNodeTest,
  49. UnsupportedExpression,
  50. AbsolutePathRequired,
  51. InvalidNCName,
  52. InvalidVariable,
  53. InvalidNumber,
  54. InvalidLiteral,
  55. InvalidOperatorName,
  56. InvalidNodeType,
  57. InvalidExpression,
  58. InvalidFunction,
  59. InvalidLocationPath,
  60. InvalidLocationStep,
  61. InvalidAxisSpecifier,
  62. InvalidNodeTest,
  63. InvalidPredicate,
  64. InvalidComparison,
  65. InvalidOrdinal,
  66. InvalidType,
  67. InvalidTypeConversion,
  68. NoNamespaceForPrefix,
  69. MismatchedParen,
  70. DuplicateOpcode,
  71. OpcodeExists,
  72. OpcodeNotFound,
  73. PredicateNestingTooDeep
  74. }
  75. internal class QueryCompileException : XPathException
  76. {
  77. QueryCompileError error;
  78. internal QueryCompileException(QueryCompileError error, string message) : base(message, null)
  79. {
  80. this.error = error;
  81. }
  82. internal QueryCompileException(QueryCompileError error) : this(error, null)
  83. {
  84. this.error = error;
  85. }
  86. public override string ToString()
  87. {
  88. return this.error.ToString();
  89. }
  90. }
  91. }