@@ -114,27 +114,30 @@ internal static string ToJspb(ExceptionLoggablePayload payload)
114114 // VisibleForTesting
115115 internal static string ToJspb ( ExceptionReport report )
116116 {
117- return string . Format (
118- "[{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10},{11},{12},{13},{14},{15},{16},{17},{18}]" ,
119- QuoteString ( report . time_msec ) ,
120- report . trapped . ToString ( ) . ToLower ( ) ,
121- QuoteString ( report . name ) ,
122- QuoteString ( report . exception_class ) ,
123- QuoteString ( report . top_exception ) ,
124- QuoteString ( report . stacktrace ) ,
125- QuoteString ( report . stacktrace_hash ) ,
126- QuoteString ( report . session_id ) ,
127- QuoteString ( report . app_id ) ,
128- QuoteString ( report . app_version_name ) ,
129- QuoteString ( report . platform ) ,
130- QuoteString ( report . unity_version ) ,
131- QuoteString ( report . os_version ) ,
132- QuoteString ( report . device_model ) ,
133- QuoteString ( report . country ) ,
134- report . total_cpu ,
135- QuoteString ( report . total_memory_bytes ) ,
136- QuoteString ( report . network_type ) ,
137- QuoteString ( report . orientation ) ) ;
117+ // The order must match the proto field numbers.
118+ var fields = new List < string >
119+ {
120+ QuoteString ( report . time_msec ) , // 1
121+ report . trapped . ToString ( ) . ToLower ( ) , // 2
122+ QuoteString ( report . name ) , // 3
123+ QuoteString ( report . exception_class ) , // 4
124+ QuoteString ( report . top_exception ) , // 5
125+ QuoteString ( report . stacktrace ) , // 6
126+ QuoteString ( report . platform ) , // 7
127+ QuoteString ( report . app_version_name ) , // 8
128+ QuoteString ( report . app_id ) , // 9
129+ QuoteString ( report . os_version ) , // 10
130+ QuoteString ( report . device_model ) , // 11
131+ report . total_cpu . ToString ( ) , // 12
132+ QuoteString ( report . total_memory_bytes ) , // 13
133+ QuoteString ( report . country ) , // 14
134+ QuoteString ( report . orientation ) , // 15
135+ QuoteString ( report . network_type ) , // 16
136+ QuoteString ( report . session_id ) , // 17
137+ QuoteString ( report . stacktrace_hash ) , // 18
138+ QuoteString ( report . unity_version ) // 19
139+ } ;
140+ return string . Format ( "[{0}]" , string . Join ( "," , fields . ToArray ( ) ) ) ;
138141 }
139142 #endregion
140143 }
0 commit comments