@@ -382,6 +382,10 @@ shared_ptr<Engine> createEngine(const EngineConfig config) {
382382 }
383383 }
384384
385+ if (url.empty ()) {
386+ throw invalid_argument (" Missing msgflo url and MSGFLO_BROKER is not set." );
387+ }
388+
385389 if (string_starts_with (url, " mqtt://" )) {
386390 string host, username, password;
387391 int port = 1883 ;
@@ -394,7 +398,7 @@ shared_ptr<Engine> createEngine(const EngineConfig config) {
394398
395399 if (i_up != string::npos) {
396400 string up = s.substr (0 , i_up);
397- cout << " up: " << up << endl;
401+ // cout << "up: " << up << endl;
398402
399403 auto i_u = up.find (' :' );
400404
@@ -404,19 +408,19 @@ shared_ptr<Engine> createEngine(const EngineConfig config) {
404408 } else {
405409 username = up;
406410 }
407- cout << " username: " << username << endl;
408- cout << " password: " << password << endl;
411+ // cout << "username: " << username << endl;
412+ // cout << "password: " << password << endl;
409413
410414 s = s.substr (i_up + 1 );
411- cout << " s: " << s << endl;
415+ // cout << "s: " << s << endl;
412416 }
413417
414418 auto i_q = s.find (' ?' );
415419
416420 if (i_q != string::npos) {
417421 host = s.substr (0 , i_q);
418422 s = s.substr (i_q + 1 );
419- cout << " s: " << s << endl;
423+ // cout << "s: " << s << endl;
420424
421425 while (!s.empty ()) {
422426 auto i_amp = s.find (' &' );
@@ -428,7 +432,7 @@ shared_ptr<Engine> createEngine(const EngineConfig config) {
428432 } else {
429433 kv = s.substr (0 , i_amp);
430434 }
431- cout << " kv: " << kv << endl;
435+ // cout << "kv: " << kv << endl;
432436
433437 auto i_eq = kv.find (' =' );
434438
@@ -439,6 +443,7 @@ shared_ptr<Engine> createEngine(const EngineConfig config) {
439443 } else {
440444 key = kv;
441445 }
446+ // cout << "key: " << key << endl;
442447
443448 if (key == " keepAlive" ) {
444449 try {
@@ -464,7 +469,7 @@ shared_ptr<Engine> createEngine(const EngineConfig config) {
464469 break ;
465470 }
466471 s = s.substr (i_amp + 1 );
467- cout << " s: " << s << endl;
472+ // cout << "s: " << s << endl;
468473 }
469474 } else {
470475 host = s;
0 commit comments