@@ -122,6 +122,9 @@ def __init__(self, spec_name: str, field_names: Sequence[str]) -> None:
122122 f"The config spec `{ spec_name } ` has dynamic type resolvers for fields: `{ field_names } `"
123123 " but these fields are not defined in the spec.\n When using @resolve_type() decorator,"
124124 f" Add the fields with 'Any' or another common type hint, example:\n \n { example } "
125+ f"The config spec `{ spec_name } ` has dynamic type resolvers for fields: `{ field_names } ` but"
126+ " these fields are not defined in the spec.\n When using `@resolve_type()` decorator, Add"
127+ f" the fields with 'Any' or another common type hint, example:\n \n { example } "
125128 )
126129 super ().__init__ (msg )
127130
@@ -131,8 +134,7 @@ class FinalConfigFieldException(ConfigurationException):
131134
132135 def __init__ (self , spec_name : str , field : str ) -> None :
133136 super ().__init__ (
134- f"Field `{ field } ` in spec `{ spec_name } ` is final but is being changed by a config"
135- " provider"
137+ f"Field `{ field } ` in spec `{ spec_name } ` is final but is being changed by a config provider"
136138 )
137139
138140
@@ -144,7 +146,7 @@ def __init__(self, field_name: str, field_value: Any, hint: type) -> None:
144146 self .field_value = field_value
145147 self .hint = hint
146148 super ().__init__ (
147- f"Can't coerce value for config field ` { field_name } ` into type { str (hint )} "
149+ f"Configured value for field { field_name } cannot be coerced into type { str (hint )} "
148150 )
149151
150152
@@ -172,7 +174,7 @@ def __init__(self, field_name: str, spec: Type[Any]) -> None:
172174 self .field_name = field_name
173175 self .typ_ = spec
174176 super ().__init__ (
175- f"Field { field_name } on configspec { spec } does not provide required type hint"
177+ f"Field ` { field_name } ` on configspec ` { spec } ` does not provide required type hint"
176178 )
177179
178180
@@ -183,7 +185,7 @@ def __init__(self, field_name: str, spec: Type[Any], typ_: Type[Any]) -> None:
183185 self .field_name = field_name
184186 self .typ_ = spec
185187 super ().__init__ (
186- f"Field { field_name } on configspec { spec } has hint with unsupported type { typ_ } "
188+ f"Field ` { field_name } ` on configspec ` { spec } ` has hint with unsupported type ` { typ_ } ` "
187189 )
188190
189191
@@ -192,7 +194,7 @@ def __init__(self, provider_name: str, key: str) -> None:
192194 self .provider_name = provider_name
193195 self .key = key
194196 super ().__init__ (
195- f"Provider { provider_name } cannot hold secret values but key { key } with secret value is"
197+ f"Provider ` { provider_name } ` cannot hold secret values but key ` { key } ` with secret value is"
196198 " present"
197199 )
198200
@@ -211,10 +213,9 @@ def __init__(
211213 self .inner_exception = inner_exception
212214 inner_msg = f" { self .inner_exception } " if inner_exception is not ValueError else ""
213215 super ().__init__ (
214- f"{ spec .__name__ } cannot parse the configuration value provided. The value is of type"
215- f" { native_value_type .__name__ } and comes from the"
216- " {embedded_sections} section(s). Value may be a secret and is not shown. "
217- f"Details: { inner_msg } "
216+ f"`{ spec .__name__ } ` cannot parse the configuration value provided. The value is of type "
217+ f"`{ native_value_type .__name__ } ` and comes from the sections `{ embedded_sections } ` "
218+ f"Value may be a secret and is not shown. Details: { inner_msg } "
218219 )
219220
220221
@@ -224,20 +225,20 @@ def __init__(self, spec: Type[Any], existing_config: Any, expected_config: Any)
224225 self .existing_config = existing_config
225226 self .expected_config = expected_config
226227 super ().__init__ (
227- f"When restoring context { spec .__name__ } , instance { expected_config } was expected,"
228- f" instead instance { existing_config } was found."
228+ f"When restoring context ` { spec .__name__ } ` , instance ` { expected_config } ` was expected,"
229+ f" instead instance ` { existing_config } ` was found."
229230 )
230231
231232
232233class ContextDefaultCannotBeCreated (ContainerException , KeyError ):
233234 def __init__ (self , spec : Type [Any ]) -> None :
234235 self .spec = spec
235- super ().__init__ (f"Container cannot create the default value of context { spec .__name__ } ." )
236+ super ().__init__ (f"Container cannot create the default value of context ` { spec .__name__ } ` ." )
236237
237238
238239class DuplicateConfigProviderException (ConfigProviderException ):
239240 def __init__ (self , provider_name : str ) -> None :
240241 super ().__init__ (
241242 provider_name ,
242- f"Provider with name { provider_name } already present in ConfigProvidersContext" ,
243+ f"Provider with name ` { provider_name } ` already present in ` ConfigProvidersContext` " ,
243244 )
0 commit comments