diff --git a/cores/esp32/WString.cpp b/cores/esp32/WString.cpp
index ded2a3c1e78..4badf63d0fe 100644
--- a/cores/esp32/WString.cpp
+++ b/cores/esp32/WString.cpp
@@ -24,6 +24,7 @@
 #include <Arduino.h>
 #include "WString.h"
 #include "stdlib_noniso.h"
+#include "esp32-hal-log.h"
 
 /*********************************************/
 /*  Constructors                             */
@@ -774,7 +775,8 @@ void String::replace(const String& find, const String& replace) {
         if(size == len())
             return;
         if(size > capacity() && !changeBuffer(size))
-            return; // XXX: tell user!
+            log_w("String.Replace() Insufficient space to replace string");
+            return;
         int index = len() - 1;
         while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) {
             readFrom = wbuffer() + index + find.len();