Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/i18n/en-US/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
"Authentication Error": "Authentication Error",
"Diagnostic Report Uploaded Successfully": "Diagnostic Report Uploaded Successfully",
"Copy Report ID": "Copy Report ID",
"The diagnostic report was securely uploaded, and the Report ID below has been copied to your clipboard. Please provide the Report ID to the Streamlabs Streamer Success Team.": "The diagnostic report was securely uploaded, and the Report ID below has been copied to your clipboard. Please provide the Report ID to the Streamlabs Streamer Success Team."
"The diagnostic report was securely uploaded, and the Report ID below has been copied to your clipboard. Please provide the Report ID to the Streamlabs Streamer Success Team.": "The diagnostic report was securely uploaded, and the Report ID below has been copied to your clipboard. Please provide the Report ID to the Streamlabs Streamer Success Team.",
"Unknown %{platform} error": "Unknown %{platform} error"
}
139 changes: 138 additions & 1 deletion app/i18n/en-US/youtube.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,142 @@
"Stream Shift Error: YouTube is not live": "Stream Shift Error: YouTube is not live",
"Error starting vertical stream in YouTube dual streaming.": "Error starting vertical stream in YouTube dual streaming.",
"YouTube service is temporarily unavailable": "YouTube service is temporarily unavailable",
"YouTube backend error return from API call. Disable YouTube to allow the user to stream. Refer user to YouTube support": "YouTube backend error return from API call. Disable YouTube to allow the user to stream. Refer user to YouTube support"
"YouTube backend error return from API call. Disable YouTube to allow the user to stream. Refer user to YouTube support": "YouTube backend error return from API call. Disable YouTube to allow the user to stream. Refer user to YouTube support",
"This channel is not in the YouTube Partner Program, so monetization settings cannot be changed.": "This channel is not in the YouTube Partner Program, so monetization settings cannot be changed.",
"You have too many live or scheduled broadcasts on YouTube. Remove some in YouTube Studio and try again.": "You have too many live or scheduled broadcasts on YouTube. Remove some in YouTube Studio and try again.",
"Streamlabs has reached YouTube's daily API limit. It resets at midnight Pacific time.": "Streamlabs has reached YouTube's daily API limit. It resets at midnight Pacific time.",
"Too many requests to YouTube in a short period. Wait a few minutes and try again.": "Too many requests to YouTube in a short period. Wait a few minutes and try again.",
"Your YouTube account has not granted Streamlabs the permissions needed to stream. Re-log or re-merge the account.": "Your YouTube account has not granted Streamlabs the permissions needed to stream. Re-log or re-merge the account.",
"Failed to upload thumbnail.": "Failed to upload thumbnail.",
"YouTube token expired, please re-merge your account": "YouTube token expired, please re-merge your account",
"YouTube API service unavailable": "YouTube API service unavailable",
"YouTube permission denied by API": "YouTube permission denied by API",
"Account Delegation Forbidden": "Account Delegation Forbidden",
"Authenticated User Account Closed": "Authenticated User Account Closed",
"Authenticated User Account Suspended": "Authenticated User Account Suspended",
"Authenticated User Not Channel": "Authenticated User Not Channel",
"Authorization Required": "Authorization Required",
"Backend Error": "Backend Error",
"Broadcast Stream Delay (ms) Required": "Broadcast Stream Delay (ms) Required",
"Category Not Found": "Category Not Found",
"CDN Required": "CDN Required",
"Channel Closed": "Channel Closed",
"Channel Forbidden": "Channel Forbidden",
"Channel Not Found": "Channel Not Found",
"Channel Suspended": "Channel Suspended",
"Closed Captions Type Modification Not Allowed": "Closed Captions Type Modification Not Allowed",
"CMS User Account Not Found": "CMS User Account Not Found",
"Concurrent Broadcasts Exceed Limit": "Concurrent Broadcasts Exceed Limit",
"Content Owner Account Not Found": "Content Owner Account Not Found",
"Default Language Not Set": "Default Language Not Set",
"Enable Auto Start Modification Not Allowed": "Enable Auto Start Modification Not Allowed",
"Enable Closed Captions Modification Not Allowed": "Enable Closed Captions Modification Not Allowed",
"Enable DVR Modification Not Allowed": "Enable DVR Modification Not Allowed",
"Enable Monitor Stream Modification Not Allowed": "Enable Monitor Stream Modification Not Allowed",
"Enable Monitor Stream Required": "Enable Monitor Stream Required",
"Error Executing Transition": "Error Executing Transition",
"Error Stream Inactive": "Error Stream Inactive",
"Forbidden": "Forbidden",
"Forbidden Embed Setting": "Forbidden Embed Setting",
"Forbidden License Setting": "Forbidden License Setting",
"Forbidden Privacy Setting": "Forbidden Privacy Setting",
"Frame Rate Required": "Frame Rate Required",
"ID Required": "ID Required",
"Incompatible Parameters": "Incompatible Parameters",
"Ingestion Type Required": "Ingestion Type Required",
"Insufficient Capabilities": "Insufficient Capabilities",
"Insufficient Live Permissions": "Insufficient Live Permissions",
"Insufficient Permissions": "Insufficient Permissions",
"Internal Error": "Internal Error",
"Invalid Auto Start": "Invalid Auto Start",
"Invalid Auto Stop": "Invalid Auto Stop",
"Invalid Category ID": "Invalid Category ID",
"Invalid Creator Cuepoint Config": "Invalid Creator Cuepoint Config",
"Invalid Criteria": "Invalid Criteria",
"Invalid Cuepoint Schedule": "Invalid Cuepoint Schedule",
"Invalid Default Broadcast Privacy Setting": "Invalid Default Broadcast Privacy Setting",
"Invalid Description": "Invalid Description",
"Invalid Eligible For Ads Monetization": "Invalid Eligible For Ads Monetization",
"Invalid Embed Setting": "Invalid Embed Setting",
"Invalid Enable Closed Captions": "Invalid Enable Closed Captions",
"Invalid Enabled": "Invalid Enabled",
"Invalid Filename": "Invalid Filename",
"Invalid Filters": "Invalid Filters",
"Invalid Format": "Invalid Format",
"Invalid Frame Rate": "Invalid Frame Rate",
"Invalid Image": "Invalid Image",
"Invalid Ingestion Type": "Invalid Ingestion Type",
"Invalid Language": "Invalid Language",
"Invalid Latency Preference Options": "Invalid Latency Preference Options",
"Invalid Mine": "Invalid Mine",
"Invalid Page Token": "Invalid Page Token",
"Invalid Part": "Invalid Part",
"Invalid Pause Ads Until": "Invalid Pause Ads Until",
"Invalid Privacy Status": "Invalid Privacy Status",
"Invalid Projection": "Invalid Projection",
"Invalid Publish At": "Invalid Publish At",
"Invalid Recording Details": "Invalid Recording Details",
"Invalid Region Code": "Invalid Region Code",
"Invalid Repeat Interval (secs)": "Invalid Repeat Interval (secs)",
"Invalid Resolution": "Invalid Resolution",
"Invalid Scheduled End Time": "Invalid Scheduled End Time",
"Invalid Scheduled Start Time": "Invalid Scheduled Start Time",
"Invalid Tags": "Invalid Tags",
"Invalid Title": "Invalid Title",
"Invalid Transition": "Invalid Transition",
"Invalid Video Game Rating": "Invalid Video Game Rating",
"Invalid Video Metadata": "Invalid Video Metadata",
"Live Broadcast Binding Not Allowed": "Live Broadcast Binding Not Allowed",
"Live Broadcast Deletion Not Allowed": "Live Broadcast Deletion Not Allowed",
"Live Broadcast Not Found": "Live Broadcast Not Found",
"Live Permission Blocked": "Live Permission Blocked",
"Live Stream Not Found": "Live Stream Not Found",
"Live Streaming Not Enabled": "Live Streaming Not Enabled",
"Media Body Required": "Media Body Required",
"Missing Ads Monetization Status": "Missing Ads Monetization Status",
"Missing Required Parameter": "Missing Required Parameter",
"Monetization Details Modification Not Allowed": "Monetization Details Modification Not Allowed",
"Pause Ads Until Modification Not Allowed": "Pause Ads Until Modification Not Allowed",
"Privacy Status Required": "Privacy Status Required",
"Quota Exceeded": "Quota Exceeded",
"Record From Start Modification Not Allowed": "Record From Start Modification Not Allowed",
"Redundant Transition": "Redundant Transition",
"Resolution Required": "Resolution Required",
"Scheduled End Time Required": "Scheduled End Time Required",
"Scheduled Start Time Required": "Scheduled Start Time Required",
"Shared Ingestion Broadcasts Exceed Limit": "Shared Ingestion Broadcasts Exceed Limit",
"Status Required": "Status Required",
"Title Required": "Title Required",
"Unexpected Parameter": "Unexpected Parameter",
"Unexpected Part": "Unexpected Part",
"Unknown Part": "Unknown Part",
"Unsupported Language Code": "Unsupported Language Code",
"Unsupported Region Code": "Unsupported Region Code",
"Upload Limit Exceeded": "Upload Limit Exceeded",
"Upload Rate Limit Exceeded": "Upload Rate Limit Exceeded",
"User Broadcasts Exceed Limit": "User Broadcasts Exceed Limit",
"User Requests Exceed Rate Limit": "User Requests Exceed Rate Limit",
"Video Category Not Found": "Video Category Not Found",
"Video Chart Not Found": "Video Chart Not Found",
"Video Not Eligible For Ads Monetization": "Video Not Eligible For Ads Monetization",
"Video Not Found": "Video Not Found",
"YouTube Signup Required": "YouTube Signup Required",
"Failed to create the YouTube broadcast": "Failed to create the YouTube broadcast",
"Failed to update the YouTube broadcast": "Failed to update the YouTube broadcast",
"Failed to delete the YouTube broadcast": "Failed to delete the YouTube broadcast",
"Failed to bind the stream to the YouTube broadcast": "Failed to bind the stream to the YouTube broadcast",
"Failed to change the status of the YouTube broadcast": "Failed to change the status of the YouTube broadcast",
"Failed to fetch your YouTube broadcasts": "Failed to fetch your YouTube broadcasts",
"Failed to create the YouTube stream": "Failed to create the YouTube stream",
"Failed to fetch the YouTube stream": "Failed to fetch the YouTube stream",
"Failed to update the YouTube video settings": "Failed to update the YouTube video settings",
"Failed to fetch the YouTube video": "Failed to fetch the YouTube video",
"Failed to upload the video to YouTube": "Failed to upload the video to YouTube",
"Failed to fetch YouTube categories": "Failed to fetch YouTube categories",
"Failed to fetch your YouTube channel": "Failed to fetch your YouTube channel",
"confirm the account is enabled for live streaming": "confirm the account is enabled for live streaming",
"confirm the broadcast is currently live or that it exists in YouTube Studio": "confirm the broadcast is currently live or that it exists in YouTube Studio",
"confirm the channel is under its broadcast limit": "confirm the channel is under its broadcast limit",
"confirm their current and upcoming broadcasts in YouTube Studio": "confirm their current and upcoming broadcasts in YouTube Studio",
"confirm their videos and current and upcoming broadcasts in YouTube Studio": "confirm their videos and current and upcoming broadcasts in YouTube Studio"
}
13 changes: 9 additions & 4 deletions app/services/platforms/base-platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import * as remote from '@electron/remote';
import { VideoSettingsService } from 'services/settings-v2/video';
import { ENotificationType, NotificationsService } from 'services/notifications';
import { IJsonRpcRequest } from 'services/api/jsonrpc';
import { throwStreamError, TStreamErrorType } from 'services/streaming/stream-error';
import { StreamError, throwStreamError, TStreamErrorType } from 'services/streaming/stream-error';
import { $t } from 'services/i18n/i18n';

const VIEWER_COUNT_UPDATE_INTERVAL = 60 * 1000;

Expand Down Expand Up @@ -152,19 +153,23 @@ export abstract class BasePlatformService<T extends IPlatformState> extends Stat
});
}

formatError(
e: any,
throwPlatformError(
platform: TPlatform,
e: StreamError | any,
errorType: TStreamErrorType = 'PLATFORM_REQUEST_FAILED',
): never {
console.error(`${platformLabels(platform)} Error: `, e);

if (e instanceof StreamError) {
throwStreamError(e.type, e, e.message);
}
Comment on lines +163 to +165

const message =
e.result?.data?.message ||
e.result?.message ||
e.statusText ||
e.message ||
`Unknown error starting ${platformLabels(platform)} stream`;
$t('Unknown %{platform} error', { platform: platformLabels(platform) });

throwStreamError(
errorType,
Expand Down
15 changes: 13 additions & 2 deletions app/services/platforms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TDisplayType } from 'services/settings-v2';
import { $t } from 'services/i18n';
import { KickService, IKickStartStreamOptions } from './kick';
import { PatreonService, IPatreonStartStreamOptions } from './patreon';
import type { TStreamErrorType } from 'services/streaming/stream-error';
import type { StreamError, TStreamErrorType } from 'services/streaming/stream-error';

export type Tag = string;
export interface IGame {
Expand Down Expand Up @@ -176,6 +176,12 @@ export interface IPlatformState {
isPrepopulated: boolean;
}

export interface IPlatformErrorCallbackProps {
e: any;
reqInfo: IPlatformRequest | string;
errorType?: TStreamErrorType;
}

// All platform services should implement this interface.
export interface IPlatformService {
capabilities: Set<TPlatformCapability>;
Expand Down Expand Up @@ -216,7 +222,12 @@ export interface IPlatformService {

postNotification?: (message: string) => void;

formatError?: (e: any, platform: TPlatform, errorType?: TStreamErrorType) => never;
createPlatformError?: (
e: any,
reqInfo: IPlatformRequest | string,
errorType?: TStreamErrorType,
fn?: (p: IPlatformErrorCallbackProps) => void,
) => StreamError;

fetchNewToken: () => Promise<void>;

Expand Down
4 changes: 2 additions & 2 deletions app/services/platforms/patreon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export class PatreonService
return res;
})
.catch(e => {
return this.formatError(e, 'patreon');
return this.throwPlatformError('patreon', e);
});
}

Expand All @@ -312,7 +312,7 @@ export class PatreonService
return res;
})
.catch(e => {
return this.formatError(e, 'patreon');
return this.throwPlatformError('patreon', e);
});
}

Expand Down
Loading
Loading