# langchainjs/release
LangChain.js langchain@1.6.4
importance: mediumfeature
This patch adds `modelRefusalMiddleware`, which throws `ModelRefusalError` when a model refuses. Middleware also passes `ModelRefusalError` through unwrapped rather than wrapping it as a `MiddlewareError`.
affected
Users handling model refusals through LangChain middleware are affected; refusals now surface as an unwrapped `ModelRefusalError`.
release_signals
+Added `modelRefusalMiddleware()` to signal model refusals with `ModelRefusalError` instead of treating them as successful runs.
# community_signal
How useful is this release to your stack?
—
net score
Sign in with GitHub to cast your vote.
Sign in with GitHub to vote
You’ll return to this release, then choose your vote.