Bug 1450098 - Rewrote part of TelemetryScalars' internal_LogScalarError to use nsPrintfCString and defined variables instead of constants; r=Dexter
authorMichael Calabrese <mcalabrese85@gmail.com>
Mon, 16 Apr 2018 17:17:53 -0400
changeset 467552 9b0b1c38b8ba6045ff6b1946d85f5e0559a9cdde
parent 467551 01b20ae8a91bf0411c7631ae0a9582eb04e3ae47
child 467553 de79e5a6aa531d3bb76a8a80a808e32232d2aa3c
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDexter
bugs1450098
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1450098 - Rewrote part of TelemetryScalars' internal_LogScalarError to use nsPrintfCString and defined variables instead of constants; r=Dexter MozReview-Commit-ID: 7UcLZEk0HCI
toolkit/components/telemetry/TelemetryScalar.cpp
--- a/toolkit/components/telemetry/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/TelemetryScalar.cpp
@@ -923,26 +923,26 @@ internal_LogScalarError(const nsACString
       break;
     case ScalarResult::InvalidType:
       errorMessage.AppendLiteral(u" - Attempted to set the scalar to an invalid data type.");
       break;
     case ScalarResult::InvalidValue:
       errorMessage.AppendLiteral(u" - Attempted to set the scalar to an incompatible value.");
       break;
     case ScalarResult::StringTooLong:
-      errorMessage.AppendLiteral(u" - Truncating scalar value to 50 characters.");
+      AppendUTF8toUTF16(nsPrintfCString(" - Truncating scalar value to %d characters.", kMaximumStringValueLength), errorMessage);
       break;
     case ScalarResult::KeyIsEmpty:
       errorMessage.AppendLiteral(u" - The key must not be empty.");
       break;
     case ScalarResult::KeyTooLong:
-      errorMessage.AppendLiteral(u" - The key length must be limited to 72 characters.");
+      AppendUTF8toUTF16(nsPrintfCString(" - The key length must be limited to %d characters.", kMaximumKeyStringLength), errorMessage);
       break;
     case ScalarResult::TooManyKeys:
-      errorMessage.AppendLiteral(u" - Keyed scalars cannot have more than 100 keys.");
+      AppendUTF8toUTF16(nsPrintfCString(" - Keyed scalars cannot have more than %d keys.", kMaximumNumberOfKeys), errorMessage);
       break;
     case ScalarResult::UnsignedNegativeValue:
       errorMessage.AppendLiteral(u" - Trying to set an unsigned scalar to a negative number.");
       break;
     case ScalarResult::UnsignedTruncatedValue:
       errorMessage.AppendLiteral(u" - Truncating float/double number.");
       break;
     default: