Skip to content

Commit 7497484

Browse files
authored
Merge pull request #85 from JanStorm/fix-error-messages
Corrects methodCall error messages
2 parents 5e07469 + db57770 commit 7497484

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

android/src/main/kotlin/me/sithiramunasinghe/flutter/flutter_radio_player/FlutterRadioPlayerPlugin.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class FlutterRadioPlayerPlugin : FlutterPlugin, ActivityAware, MethodChannel.Met
163163
}
164164
"use_icy_data" -> {
165165
if (!isBound) {
166-
result.error("FRP_002", "Failed to call init_periodic_metadata", null)
166+
result.error("FRP_002", "Failed to call use_icy_data", null)
167167
throw FRPException("FRPCoreService has not been initialized yet")
168168
}
169169
frpRadioPlayerService.useIcyData(status = true)
@@ -187,7 +187,7 @@ class FlutterRadioPlayerPlugin : FlutterPlugin, ActivityAware, MethodChannel.Met
187187
}
188188
"stop" -> {
189189
if (!isBound) {
190-
result.error("FRP_004", "Failed to call pause", null)
190+
result.error("FRP_004", "Failed to call stop", null)
191191
throw FRPException("FRPCoreService has not been initialized yet")
192192
}
193193
frpRadioPlayerService.stop()
@@ -211,15 +211,15 @@ class FlutterRadioPlayerPlugin : FlutterPlugin, ActivityAware, MethodChannel.Met
211211
}
212212
"previous_source" -> {
213213
if (!isBound) {
214-
result.error("FRP_007", "Failed to call prev_source", null)
214+
result.error("FRP_007", "Failed to call previous_source", null)
215215
throw FRPException("FRPCoreService has not been initialized yet")
216216
}
217217
frpRadioPlayerService.prevMediaItem()
218218
result.success("success")
219219
}
220220
"seek_source_to_index" -> {
221221
if (!isBound) {
222-
result.error("FRP_008", "Failed to call prev_source", null)
222+
result.error("FRP_008", "Failed to call seek_source_to_index", null)
223223
throw FRPException("FRPCoreService has not been initialized yet")
224224
}
225225
val sourceIndex: Int = call.argument<Int>("source_index") ?: 0
@@ -262,7 +262,7 @@ class FlutterRadioPlayerPlugin : FlutterPlugin, ActivityAware, MethodChannel.Met
262262
}
263263
"get_playback_state" -> {
264264
if (!isBound) {
265-
result.error("FRP_013", "Failed to call set_sources", null)
265+
result.error("FRP_013", "Failed to call get_playback_state", null)
266266

267267
throw FRPException("FRPCoreService has not been initialized yet")
268268
}

0 commit comments

Comments
 (0)