|
16 | 16 | Module that contains exception messages for the Cloudant Python client |
17 | 17 | library. |
18 | 18 | """ |
| 19 | +ARGUMENT_ERROR = { |
| 20 | + 100: 'A general Cloudant argument error was raised.', |
| 21 | + # Client |
| 22 | + 101: 'Invalid year and/or month supplied. Found: year - {0}, month - {1}', |
| 23 | + # Database |
| 24 | + 102: 'Invalid role(s) provided: {0}. Valid roles are: {1}', |
| 25 | + 103: 'Invalid index type: {0}. Index type must be ' |
| 26 | + 'either \"json\" or \"text\".', |
| 27 | + 104: 'A single query/q parameter is required. Found: {0}', |
| 28 | + 105: 'Invalid argument: {0}', |
| 29 | + 106: 'Argument {0} is not an instance of expected type: {1}', |
| 30 | + # Design document |
| 31 | + 107: 'View {0} already exists in this design doc.', |
| 32 | + 108: 'An index with name {0} already exists in this design doc.', |
| 33 | + 109: 'A list with name {0} already exists in this design doc.', |
| 34 | + 110: 'A show function with name {0} already exists in this design doc.', |
| 35 | + 111: 'View {0} does not exist in this design doc.', |
| 36 | + 112: 'An index with name {0} does not exist in this design doc.', |
| 37 | + 113: 'A list with name {0} does not exist in this design doc.', |
| 38 | + 114: 'A show function with name {0} does not exist in this design doc.', |
| 39 | + # Feed |
| 40 | + 115: 'Error converting argument {0}: {1}', |
| 41 | + 116: 'Invalid argument {0}', |
| 42 | + 117: 'Argument {0} not instance of expected type: {1}', |
| 43 | + 118: 'Argument {0} must be > 0. Found: {1}', |
| 44 | + 119: 'Invalid value ({0}) for feed option. Must be one of {1}', |
| 45 | + 120: 'Invalid value ({0}) for style option. Must be main_only, ' |
| 46 | + 'or all_docs.', |
| 47 | + 121: 'Invalid infinite feed option: {0}. Must be set to continuous.', |
| 48 | + # Index |
| 49 | + 122: 'The design document id: {0} is not a string.', |
| 50 | + 123: 'The index name: {0} is not a string.', |
| 51 | + 124: '{0} provided as argument(s). A JSON index requires that ' |
| 52 | + 'only a \'fields\' argument is provided.', |
| 53 | + 125: 'Deleting an index requires a design document id be provided.', |
| 54 | + 126: 'Deleting an index requires an index name be provided.', |
| 55 | + 127: 'Invalid argument: {0}', |
| 56 | + 128: 'Argument {0} is not an instance of expected type: {1}', |
| 57 | + # Query |
| 58 | + 129: 'Invalid argument: {0}', |
| 59 | + 130: 'Argument {0} is not an instance of expected type: {1}', |
| 60 | + 131: 'No selector in the query or the selector was empty. ' |
| 61 | + 'Add a selector to define the query and retry.', |
| 62 | + # View |
| 63 | + 132: 'The map property must be a dictionary.', |
| 64 | + 133: 'The reduce property must be a string.', |
| 65 | + # Common_util |
| 66 | + 134: 'Key list element not of expected type: {0}', |
| 67 | + 135: 'Invalid value for stale option {0} must be ok or update_after.', |
| 68 | + 136: 'Error converting argument {0}: {1}' |
| 69 | +} |
| 70 | + |
19 | 71 | CLIENT = { |
20 | 72 | 100: 'A general Cloudant client exception was raised.', |
21 | | - 101: 'Value must be set to a Database object. Found type: {0}.', |
| 73 | + 101: 'Value must be set to a Database object. Found type: {0}', |
22 | 74 | 102: 'You must provide a url or an account.', |
23 | 75 | 404: 'Database {0} does not exist. Verify that the client is valid and try again.', |
24 | 76 | 409: 'Database {0} already exists.' |
25 | 77 | } |
26 | 78 |
|
27 | 79 | DATABASE = { |
28 | 80 | 100: 'A general Cloudant database exception was raised.', |
29 | | - 101: 'Unexpected index type. Found: {0}.', |
| 81 | + 101: 'Unexpected index type. Found: {0}', |
30 | 82 | 400: 'Invalid database name during creation. Found: {0}', |
31 | | - 401: 'Unauthorized to create database {0}.', |
| 83 | + 401: 'Unauthorized to create database {0}', |
32 | 84 | 409: 'Document with id {0} already exists.' |
33 | 85 | } |
34 | 86 |
|
|
74 | 126 | RESULT = { |
75 | 127 | 100: 'A general result exception was raised.', |
76 | 128 | 101: 'Failed to interpret the argument {0} as a valid key value or as a valid slice.', |
77 | | - 102: 'Cannot use {0} when performing key access or key slicing. Found {1}.', |
78 | | - 103: 'Cannot use {0} for iteration. Found {1}.', |
| 129 | + 102: 'Cannot use {0} when performing key access or key slicing. Found {1}', |
| 130 | + 103: 'Cannot use {0} for iteration. Found {1}', |
79 | 131 | 104: 'Invalid page_size: {0}' |
80 | 132 | } |
| 133 | + |
| 134 | +VIEW = { |
| 135 | + 100: 'A general view exception was raised.', |
| 136 | + 101: 'A QueryIndexView is not callable. If you wish to execute a query ' |
| 137 | + 'use the database \'get_query_result\' convenience method.', |
| 138 | + 102: 'Cannot create a custom result context manager using a ' |
| 139 | + 'QueryIndexView. If you wish to execute a query use the ' |
| 140 | + 'database \'get_query_result\' convenience method instead.' |
| 141 | +} |
0 commit comments