|
- {"abstract":[{"type":"text","text":"Handles errors during WebSocket communication."}],"variants":[{"paths":["\/documentation\/fueling\/websocketviewmodel\/handleerror(_:)"],"traits":[{"interfaceLanguage":"swift"}]}],"primaryContentSections":[{"kind":"declarations","declarations":[{"languages":["swift"],"tokens":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"text":"handleError","kind":"identifier"},{"text":"(","kind":"text"},{"text":"_","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"error","kind":"internalParam"},{"text":": ","kind":"text"},{"text":"Error","preciseIdentifier":"s:s5ErrorP","kind":"typeIdentifier"},{"text":"?)","kind":"text"}],"platforms":["iOS"]}]},{"parameters":[{"name":"error","content":[{"type":"paragraph","inlineContent":[{"text":"The error encountered during WebSocket communication.","type":"text"}]}]}],"kind":"parameters"},{"content":[{"text":"Discussion","level":2,"type":"heading","anchor":"discussion"},{"type":"paragraph","inlineContent":[{"type":"text","text":"This method processes errors encountered during WebSocket communication and attempts to reconnect."}]},{"type":"codeListing","syntax":"swift","code":["func handleError(_ error: Error?) {"," if let e = error as? WSError {"," print(\"websocket encountered an error: \\(e.message)\")"," } else if let e = error {"," print(\"websocket encountered an error: \\(e.localizedDescription)\")"," } else {"," print(\"websocket encountered an error\")"," }"," socket.connect()","}"]}],"kind":"content"}],"schemaVersion":{"major":0,"minor":3,"patch":0},"hierarchy":{"paths":[["doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/WebSocketViewModel"]]},"sections":[],"identifier":{"url":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/WebSocketViewModel\/handleError(_:)","interfaceLanguage":"swift"},"metadata":{"fragments":[{"kind":"keyword","text":"func"},{"text":" ","kind":"text"},{"kind":"identifier","text":"handleError"},{"kind":"text","text":"("},{"preciseIdentifier":"s:s5ErrorP","kind":"typeIdentifier","text":"Error"},{"text":"?)","kind":"text"}],"title":"handleError(_:)","role":"symbol","modules":[{"name":"Fueling"}],"roleHeading":"Instance Method","externalID":"s:7Fueling18WebSocketViewModelC11handleErroryys0G0_pSgF","symbolKind":"method"},"kind":"symbol","references":{"doc://rpm.com.production.Scanner/documentation/Fueling/WebSocketViewModel":{"kind":"symbol","role":"symbol","fragments":[{"kind":"keyword","text":"class"},{"text":" ","kind":"text"},{"kind":"identifier","text":"WebSocketViewModel"}],"navigatorTitle":[{"kind":"identifier","text":"WebSocketViewModel"}],"abstract":[{"text":"The ","type":"text"},{"type":"codeVoice","code":"WebSocketViewModel"},{"type":"text","text":" class is responsible for managing WebSocket connections, handling messages, and updating application state based on WebSocket events."}],"url":"\/documentation\/fueling\/websocketviewmodel","type":"topic","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/WebSocketViewModel","title":"WebSocketViewModel"},"doc://rpm.com.production.Scanner/documentation/Fueling/WebSocketViewModel/handleError(_:)":{"abstract":[{"text":"Handles errors during WebSocket communication.","type":"text"}],"fragments":[{"kind":"keyword","text":"func"},{"kind":"text","text":" "},{"kind":"identifier","text":"handleError"},{"text":"(","kind":"text"},{"kind":"typeIdentifier","preciseIdentifier":"s:s5ErrorP","text":"Error"},{"kind":"text","text":"?)"}],"title":"handleError(_:)","type":"topic","url":"\/documentation\/fueling\/websocketviewmodel\/handleerror(_:)","role":"symbol","kind":"symbol","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling\/WebSocketViewModel\/handleError(_:)"},"doc://rpm.com.production.Scanner/documentation/Fueling":{"kind":"symbol","url":"\/documentation\/fueling","title":"Fueling","identifier":"doc:\/\/rpm.com.production.Scanner\/documentation\/Fueling","abstract":[{"type":"text","text":"The Scanner app is designed to facilitate secure and efficient fuel management operations, primarily focusing on user authentication, fuel data collection, and network communication. The app includes several key features to ensure seamless and reliable interactions between users and the backend systems, leveraging technologies like WebSockets, Core Data, and biometric authentication."}],"type":"topic","role":"collection"}}}
|