Azure / Azure/azure-functions-java-worker
Catching uncaught exceptions by means of request hooks
- Lingua principale
- Java
- Stelle
- 103
- Fork
- 74
- Merge medio
- 4g 8h
- PR unite (30g)
- 2
Descrizione
#### Investigative information
My question is two-folded:
1) I would like to know if there is a notion of pre-execution and post-execution hooks, meaning:
when a function is invoked, are there hooks exposed that will be called _before and after_ the function handler is invoked?
2) Is there a way by means of a _post-hook_ to catch uncaught exceptions? If not, what alternative can I use, (for example: an Exception Listener)?
#### Repro steps
For example, if I have a function handler like below (which is written in Kotlin), what abilities can I utilise to catch an exception if one occurs, that is not explicitly caught by a try/catch block?
```kotlin
class Function {
fun foobar(name: String?, context: ExecutionContext): String {
// mimicking an uncaught exception
throw Exception()
return "Foobar"
}
}
```
#### Expected behavior
A post-hook interface that creates the ability to implement the interface and define behaviour of pre/post-execution and on exception behaviour, for example:
```kotlin
interface PostExecutionRequestHandler {
fun onException(exception: ExecutionException)
}
```
Copied from original issue: [Azure/azure-functions-java-library#82](https://github.com/Azure/azure-functions-java-library/issues/82)
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
L’issue non indica file, test o punti di ingresso del worker. Inizia individuando i percorsi di esecuzione delle request e di gestione delle eccezioni del worker Java, quindi determina se esistono già hook pre/post; il lavoro è completo quando è stato implementato un design concordato per gli hook o per la gestione delle eccezioni ed è coperto da test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, java, kotlin
- Ambito
- backend, cloud
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100