Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
Google Cloud Functions - permission-denied vs failed-precondition

Which HTTPs error type should I use when checking that the auth id is present?

const userId = context.auth.token.uid;

if (!userId) {
  throw new functions.https.HttpsError(
    "failed-precondition",
    "Authentication required."
  );
}

or

const userId = context.auth.token.uid;

if (!userId) {
  throw new functions.https.HttpsError(
    "permission-denied",
    "Authentication required."
  );
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Actually you can choose the error type you prefer among the list of available error types. As a matter of fact, this error code is going to be sent back to your front-end, which you normally control.

Now, looking at the list of error codes...

permission-denied: The caller does not have permission to execute the specified operation.

failed-precondition: Operation was rejected because the system is not in a state required for the operation's execution.

... I would choose permission-denied.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda