grafana / xk6-webcrypto

WIP implementation of the WebCrypto specification for k6
GNU Affero General Public License v3.0
7 stars 4 forks source link

Handling panics in encrypt/decrypt #78

Open olegbespalov opened 6 months ago

olegbespalov commented 6 months ago

What?

As #66 showcased, there could be cases where using some specific methods (even from Golang's standard library) could lead to panic.

This PR introduces a way to handle such panics and "convert" them into regular errors. If the approach makes sense, we could use all of the main webcrypto methods. Later on, some generic abstraction could be considered to make all web crypto methods bootstrap free.

Why?

Panics terminate k6 whenever. For such cases, it's just an application-level error.

Closes #66