packages/exception/docs/api/serializer/functions/toJson.md
[**@httpx/exception**](../../README.md) • **Docs**
---
[@httpx/exception](../../README.md) / [serializer](../README.md) / toJson
# Function: toJson()
> **toJson**(`exception`, `params`?): `string`
## Parameters
• **exception**: [`HttpException`](../../base/classes/HttpException.md) \| [`NativeError`](../type-aliases/NativeError.md)
• **params?**: `SerializerParams`
## Returns
`string`