Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

106
Views
How to log errors full stack trace with google cloud functions

There is a backend service I found in some codebase I'm recently working on and would like to log all the errors with their respective Http statuses if possible get the full stack trace of the errors. Most likely log the errors from this backend service. The next code snippet shows an example of how the backend service is used. This is my first time working with cloud functions

backend.service.ts

import { Injectable } from '@angular/core';

import { AngularFireFunctions } from '@angular/fire/compat/functions';

/**
 * Interface with the firebase backend.
 */
@Injectable({ providedIn: 'root' })
export class BackendService
{
  constructor(private _fns: AngularFireFunctions) { }

  /**
   * Call Firebase Cloud Function
   *
   * @param fName:  Function Name
   * @param params: Function Parameter Object
   */
  callFunction(fName: string, params: any) {
    const toCall = this._fns.httpsCallable(fName);

     // log errors here 
    return toCall(params) 
  }

}

Using backend service

import { Injectable } from '@angular/core';

import { Provision, WriteProvisionCommand } from '@s4y/model/accounting/provisions';

import { BackendService } from '@bxy/utils/ngxfm/angular';
import { DbMethods } from '@bxy/model/data/db';


@Injectable()
export class RequestWithSettlementService
{
  constructor(private _backend: BackendService
              )
  {}


  deleteBill = (propId: string, tr: FTransactionRequest) => this.deleteProvision(propId, tr as any as Provision);

  deleteProvision(propId: string, tr: FTransactionRequest)
  {
    const call: WriteProvisionCommand = {
      provision: tr,
      propId,
      method: DbMethods.DELETE
    };

    return this._backend.callFunction('writeProvision', call);
  }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!