@@ -123,8 +123,8 @@ export class ErrorMessage {
123123 * error was reported
124124 * @returns {this } - returns the instance for chaining
125125 */
126- setServiceContext ( service : string , version ?: string ) {
127- this . serviceContext . service = isString ( service ) ? service : 'node' ;
126+ setServiceContext ( service ? : string , version ?: string ) {
127+ this . serviceContext . service = ( isString ( service ) ? service : 'node' ) ! ;
128128 this . serviceContext . version = isString ( version ) ? version : undefined ;
129129
130130 return this ;
@@ -136,8 +136,8 @@ export class ErrorMessage {
136136 * @param {String } message - the error message
137137 * @returns {this } - returns the instance for chaining
138138 */
139- setMessage ( message : string ) {
140- this . message = isString ( message ) ? message : '' ;
139+ setMessage ( message ? : string ) {
140+ this . message = ( isString ( message ) ? message : '' ) ! ;
141141
142142 return this ;
143143 }
@@ -149,8 +149,8 @@ export class ErrorMessage {
149149 * errors instantiation
150150 * @returns {this } - returns the instance for chaining
151151 */
152- setHttpMethod ( method : string ) {
153- this . context . httpRequest . method = isString ( method ) ? method : '' ;
152+ setHttpMethod ( method ? : string ) {
153+ this . context . httpRequest . method = ( isString ( method ) ? method : '' ) ! ;
154154
155155 return this ;
156156 }
@@ -161,8 +161,8 @@ export class ErrorMessage {
161161 * @param {String } url - the requests target url
162162 * @returns {this } - returns the instance for chaining
163163 */
164- setUrl ( url : string ) {
165- this . context . httpRequest . url = isString ( url ) ? url : '' ;
164+ setUrl ( url ? : string ) {
165+ this . context . httpRequest . url = ( isString ( url ) ? url : '' ) ! ;
166166
167167 return this ;
168168 }
@@ -173,8 +173,9 @@ export class ErrorMessage {
173173 * @param {String } userAgent - the requests user-agent
174174 * @returns {this } - returns the instance for chaining
175175 */
176- setUserAgent ( userAgent : string ) {
177- this . context . httpRequest . userAgent = isString ( userAgent ) ? userAgent : '' ;
176+ setUserAgent ( userAgent ?: string ) {
177+ this . context . httpRequest . userAgent =
178+ ( isString ( userAgent ) ? userAgent : '' ) ! ;
178179
179180 return this ;
180181 }
@@ -185,8 +186,8 @@ export class ErrorMessage {
185186 * @param {String } referrer - the requests referrer
186187 * @returns {this } - returns the instance for chaining
187188 */
188- setReferrer ( referrer : string ) {
189- this . context . httpRequest . referrer = isString ( referrer ) ? referrer : '' ;
189+ setReferrer ( referrer ? : string ) {
190+ this . context . httpRequest . referrer = ( isString ( referrer ) ? referrer : '' ) ! ;
190191
191192 return this ;
192193 }
@@ -197,9 +198,9 @@ export class ErrorMessage {
197198 * @param {Number } responseStatusCode - the response status code
198199 * @returns {this } - returns the instance for chaining
199200 */
200- setResponseStatusCode ( responseStatusCode : number ) {
201+ setResponseStatusCode ( responseStatusCode ? : number ) {
201202 this . context . httpRequest . responseStatusCode =
202- isNumber ( responseStatusCode ) ? responseStatusCode : 0 ;
203+ ( isNumber ( responseStatusCode ) ? responseStatusCode : 0 ) ! ;
203204
204205 return this ;
205206 }
@@ -210,8 +211,8 @@ export class ErrorMessage {
210211 * @param {String } remoteIp - the requesters remote IP
211212 * @returns {this } - returns the instance for chaining
212213 */
213- setRemoteIp ( remoteIp : string ) {
214- this . context . httpRequest . remoteIp = isString ( remoteIp ) ? remoteIp : '' ;
214+ setRemoteIp ( remoteIp ? : string ) {
215+ this . context . httpRequest . remoteIp = ( isString ( remoteIp ) ? remoteIp : '' ) ! ;
215216
216217 return this ;
217218 }
@@ -222,8 +223,8 @@ export class ErrorMessage {
222223 * @param {String } user - the vm instances user
223224 * @returns {this } - returns the instance for chaining
224225 */
225- setUser ( user : string ) {
226- this . context . user = isString ( user ) ? user : '' ;
226+ setUser ( user ? : string ) {
227+ this . context . user = ( isString ( user ) ? user : '' ) ! ;
227228
228229 return this ;
229230 }
@@ -234,8 +235,9 @@ export class ErrorMessage {
234235 * @param {String } filePath - the vm instances filePath
235236 * @returns {this } - returns the instance for chaining
236237 */
237- setFilePath ( filePath : string ) {
238- this . context . reportLocation . filePath = isString ( filePath ) ? filePath : '' ;
238+ setFilePath ( filePath ?: string ) {
239+ this . context . reportLocation . filePath =
240+ ( isString ( filePath ) ? filePath : '' ) ! ;
239241
240242 return this ;
241243 }
@@ -246,9 +248,9 @@ export class ErrorMessage {
246248 * @param {Number } lineNumber - the line number of the report context
247249 * @returns {this } - returns the instance for chaining
248250 */
249- setLineNumber ( lineNumber : number ) {
251+ setLineNumber ( lineNumber ? : number ) {
250252 this . context . reportLocation . lineNumber =
251- isNumber ( lineNumber ) ? lineNumber : 0 ;
253+ ( isNumber ( lineNumber ) ? lineNumber : 0 ) ! ;
252254
253255 return this ;
254256 }
@@ -259,9 +261,9 @@ export class ErrorMessage {
259261 * @param {String } functionName - the function name of the report context
260262 * @returns {this } - returns the instance for chaining
261263 */
262- setFunctionName ( functionName : string ) {
264+ setFunctionName ( functionName ? : string ) {
263265 this . context . reportLocation . functionName =
264- isString ( functionName ) ? functionName : '' ;
266+ ( isString ( functionName ) ? functionName : '' ) ! ;
265267
266268 return this ;
267269 }
0 commit comments