  * Uploads the telegram in the given `buffer` of `size` bytes to the server.
  * Returns `true` on success.
  */
-bool uploadTelegram(byte const *buffer, uint16 size) {
+ErrorCode uploadTelegram(byte const *buffer, uint16 size) {
   if (!httpsClient.connect(SERVER_HOST, SERVER_PORT)) {
     Serial.print("Failed to connect to " SERVER_HOST ":");
     Serial.print(SERVER_PORT);
     Serial.println();
-    flashNumber(SERVER_CONNECT_ERROR);
-    return false;
+    return SERVER_CONNECT_ERROR;
   }
 
   if (!httpsClient.verify(SERVER_CERTIFICATE_FINGERPRINT, SERVER_HOST)) {
     Serial.println("Certificate verification failed");
     httpsClient.stop();
-    flashNumber(SERVER_SSL_ERROR);
-    return false;
+    return SERVER_SSL_ERROR;
   }
 
   httpsClient.print(

    byte b = httpsClient.read();
    if (b < 0) {
      httpsClient.stop();
      flashNumber(SERVER_READ_ERROR);
      return false;
    }
    if (!isDigit(b)) {
      break;

  digitalWrite(LED_PIN, on ? LOW : HIGH);
}

void flashLed(int ms) {
  setLed(true);
  delay(ms);
  setLed(false);
