Skip to content

Commit

Permalink
refactor: Improve Ionic Native warnings (#2611)
Browse files Browse the repository at this point in the history
- Explicitly spell out that this is coming from "Ionic Native", instead of just "Native"
- Improve sentence that explains 2 most common reasons for missing Cordova
  • Loading branch information
janpio authored and danielsogl committed Jul 29, 2018
1 parent 3b32e19 commit c671386
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/@ionic-native/core/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const pluginWarn = (
): void => {
if (method) {
console.warn(
'Native: tried calling ' +
'Ionic Native: tried calling ' +
pluginName +
'.' +
method +
Expand All @@ -63,12 +63,12 @@ export const pluginWarn = (
);
} else {
console.warn(
`'Native: tried accessing the ${pluginName} plugin but it's not installed.`
`'Ionic Native: tried accessing the ${pluginName} plugin but it's not installed.`
);
}
if (plugin) {
console.warn(
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
`Install the ${pluginName} plugin: 'ionic cordova plugin add ${plugin}'`
);
}
};
Expand All @@ -81,17 +81,17 @@ export const pluginWarn = (
export const cordovaWarn = (pluginName: string, method?: string): void => {
if (method) {
console.warn(
'Native: tried calling ' +
'Ionic Native: tried calling ' +
pluginName +
'.' +
method +
', but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
', but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
);
} else {
console.warn(
'Native: tried accessing the ' +
pluginName +
' plugin but Cordova is not available. Make sure to include cordova.js or run in a device/simulator'
' plugin but Cordova is not available. Make sure to a) run in a real device or simulator and b) include cordova.js in your index.html'
);
}
};

0 comments on commit c671386

Please sign in to comment.