-
Notifications
You must be signed in to change notification settings - Fork 282
Custom error codes on the plugin side #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom error codes on the plugin side #238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very, very good!
Add some doc about the exported func and it will be good to go!
P.S: I tested it with go-flutter master as base since in beta it gives me the following error in my machine.
What is your flutter beta version?, on Flutter 1.8.3 • channel beta
the reference to FlutterPlatformMessageReleaseResponseHandle
is available in the engine.
plugin/method-channel.go
Outdated
@@ -223,3 +232,20 @@ func (m *MethodChannel) handleMethodCall(handler MethodHandler, methodName strin | |||
} | |||
responseSender.Send(binaryReply) | |||
} | |||
|
|||
type PluginError struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add comment describing what PluginError|Error|NewPluginError
are for. (make golint happy)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Drakirus Ok, I added some docs.
@Drakirus
Alright, I was using the wrong flutter binary. Thanks! |
get vet output: |
@Drakirus I didn't know about |
FYI, read https://blog.golang.org/godoc-documenting-go-code |
fb8dcf0
to
05830cb
Compare
Thank for your contribution! 👍 |
You are welcome. Thank you for your work! |
Great addition! |
* Texture support (#217) * Feature/event loop interop (#218) * Feature/callback messages (#220) * fix: remove initial WaitEvent now that we have implemented the proper event loop. Delete the first WaitEvent * lazy initialize go-gl/gl on first texture frame * align BinaryMessenger with *-channels BinaryMessenger: SendNoReply -> Send Send -> SendWithReply * change the priorityQueue to specifically contain embedder.FlutterTask's * Adds comments and renames internals. Also some re-ordering of init code. (#235) * Addressing comments & fix pointer warning * implement RunOnCurrentThread check using C call * Custom error codes on the plugin side (#238) Custom error codes on the plugin side * rely on LockOSThread to ensure engine task are run on the same thread
There are Flutter plugins that use custom error codes when returning to the Dart side.
For instance, Sqflite here.
It is a non breaking change.
I created another PR using this feature in the examples repo. #28
P.S: I tested it with go-flutter master as base since in beta it gives me the following error in my machine.