0

I use TypeScript in my callable Cloud functions. Their structure looks something like this:

exports.sayHello = functions.https.onCall(async (data, context) => { try { const email: string = data.email; const isStudent: boolean = data.isStudent if (isStudent) { const mathGrade: string = data.mathgrade; try { // Access Firestore } catch (error) { // Throw Https error } } else { const mainSubject: string = data.mainsubject; try { // Access Firestore } catch (error) { // Throw Https error } } } catch (error) { // Handle type error (the typecasting failed because of the json data) } }); 

My question now is if the Https errors I throw would be caught by the outer try catch block, because what I want is send them to client

1 Answer 1

1

Yes, it would be caught by the outer catch.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.