File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -235,12 +235,24 @@ _mongoc_sasl_is_failure (int status, bson_error_t *error)
235
235
status ,
236
236
"SASL Failure: insufficient memory." );
237
237
break ;
238
- case SASL_NOMECH :
238
+ case SASL_NOMECH : {
239
+ bson_string_t * str = bson_string_new ("available mechanisms: " );
240
+ const char * * mechs = sasl_global_listmech ();
241
+ int i = 0 ;
242
+
243
+ for (i = 0 ; mechs [i ]; i ++ ) {
244
+ bson_string_append (str , mechs [i ]);
245
+ if (mechs [i + 1 ]) {
246
+ bson_string_append (str , "," );
247
+ }
248
+ }
239
249
bson_set_error (error ,
240
250
MONGOC_ERROR_SASL ,
241
251
status ,
242
- "SASL Failure: failure to negotiate mechanism" );
243
- break ;
252
+ "SASL Failure: failure to negotiate mechanism (%s)" ,
253
+ str -> str );
254
+ bson_string_free (str , 0 );
255
+ } break ;
244
256
case SASL_BADPARAM :
245
257
bson_set_error (error ,
246
258
MONGOC_ERROR_SASL ,
You can’t perform that action at this time.
0 commit comments