I was trying to inherit ResponseCodeInterceptor to intercept the status code but I am receiving error :
Cannot inherit from non-open class 'ResponseCodeInterceptor' outside of its defining module
Attached the image
Please let me know if iam implementing this in a good way
I need to intercept Status codes like 400,401,404
Is this the right way ?

Since this is a question I'm going to move it to Discussions
Welp GH seems to have temporarily disabled that feature so I guess we're staying here: The included interceptors themselves are not designed to be subclassed. You can create your own interceptors by conforming to the ApolloInterceptor protocol and then placing them in the array of interceptors created in the InterceptorProvider as you'd like.
However, in this particular case I'd look at adding your error logger as an AdditionalErrorInterceptor, which is a secondary protocol that gets called before errors are returned to the caller. That'll allow you to log all errors that occur regardless of where in the chain they happen.
Thanks @designatednerd for your quick response.
So mainly I should benefit from the exisiting interceptors or create my own protocol as you stated.
I will take this path and handle our custom reponse code especialle 401 errors
Not your own protocol, your own class or struct conforming to one of the two protocols, ApolloInterceptor or ApolloErrorInterceptor
Oh I wrote protocol by mistake.
Thank you Ellen
@sam961 In the future if you've got a question, please open it in the Discussions tab. I'm going to go ahead and close this issue out. Thank you!