Skip to content

Commit

Permalink
catch on new line
Browse files Browse the repository at this point in the history
  • Loading branch information
spessasus committed Oct 6, 2024
1 parent 17daa55 commit a4f230e
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/spessasynth_lib/external_midi/midi_handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export class MIDIDeviceHandler
this.outputs = response.outputs;
SpessaSynthInfo("%cMIDI handler created!", consoleColors.recognized);
return true;
} catch (e)
}
catch (e)
{
SpessaSynthWarn(`Could not get MIDI Devices:`, e);
this.inputs = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export function loadNewSongList(midiBuffers)
try
{
mids.push(new MIDI(b.binary, b.altName || ""));
} catch (e)
}
catch (e)
{
this.post(WorkletSequencerReturnMessageType.midiError, e.message);
return mids;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export class BasicSample
// flag as compressed
this.sampleType |= 0x10;
this.isCompressed = true;
} catch (e)
}
catch (e)
{
SpessaSynthWarn(`Failed to compress ${this.sampleName}. Leaving as uncompressed!`);
this.isCompressed = false;
Expand Down
3 changes: 2 additions & 1 deletion src/spessasynth_lib/soundfont/read_sf2/soundfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export class SoundFont2 extends BasicSoundFont
this.dataArray.currentIndex,
this.dataArray.currentIndex + sdtaChunk.size - 12
)).data[0];
} catch (e)
}
catch (e)
{
SpessaSynthGroupEnd();
throw new Error(`SF2Pack Ogg Vorbis decode error: ${e}`);
Expand Down
3 changes: 2 additions & 1 deletion src/spessasynth_lib/synthetizer/synthetizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ export class Synthetizer
startRenderingData: startRenderingData
}
});
} catch (e)
}
catch (e)
{
throw new Error("Could not create the audioWorklet. Did you forget to addModule()?");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ class SpessaSynthProcessor extends AudioWorkletProcessor
options.processorOptions.soundfont,
this.postReady.bind(this)
);
} catch (e)
}
catch (e)
{
this.post({
messageType: returnMessageType.soundfontError,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ export function reloadSoundFont(buffer, isOverride = false)
{
this.soundfontManager.reloadManager(buffer);
}
} catch (e)
}
catch (e)
{
this.post({
messageType: returnMessageType.soundfontError,
Expand Down
3 changes: 2 additions & 1 deletion src/website/js/dls_to_sf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ document.getElementById("dls_upload").oninput = e =>
try
{
sfont = loadSoundFont(await file.arrayBuffer());
} catch (e)
}
catch (e)
{
message.style.color = "red";
message.innerText = `Error: ${e.message}`;
Expand Down
9 changes: 6 additions & 3 deletions src/website/js/main/demo_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ async function saveSoundFontToIndexedDB(arr)
{
console.error("Error saving soundfont", e);
};
} catch (e)
}
catch (e)
{
SpessaSynthWarn("Failed saving soundfont:", e);
}
Expand All @@ -139,7 +140,8 @@ async function demoInit(initLocale)
{
const context = window.AudioContext || window.webkitAudioContext;
window.audioContextMain = new context({ sampleRate: SAMPLE_RATE });
} catch (e)
}
catch (e)
{
changeIcon(getExclamationSvg(256));
loadingMessage.textContent = localeManager.getLocaleString("locale.synthInit.noWebAudio");
Expand Down Expand Up @@ -435,7 +437,8 @@ demoInit(initLocale).then(() =>
{
soundFontBuffer = await file.arrayBuffer();
window.soundFontParser = soundFontBuffer;
} catch (e)
}
catch (e)
{
loadingMessage.textContent = window.manager.localeManager.getLocaleString(
"locale.warnings.outOfMemory");
Expand Down
3 changes: 2 additions & 1 deletion src/website/js/main/local_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ async function fetchFont(fileName, callback)
try
{
dataArray = new Uint8Array(parseInt(size));
} catch (e)
}
catch (e)
{
let message = `Your browser ran out of memory. Consider using Firefox or SF3 soundfont instead<br><br> (see console for error)`;
if (window.manager)
Expand Down
3 changes: 2 additions & 1 deletion src/website/js/manager/export_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ export async function _doExportAudioData(normalizeAudio = true, additionalTime =
chorusConfig: undefined,
reverbImpulseResponse: this.impulseResponse
});
} catch (e)
}
catch (e)
{
showNotification(
this.localeManager.getLocaleString("locale.warnings.warning"),
Expand Down
6 changes: 4 additions & 2 deletions src/website/js/manager/export_song.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export async function exportSong()
try
{
this._exportSoundfont();
} catch (e)
}
catch (e)
{
showNotification(
"Warning",
Expand All @@ -58,7 +59,8 @@ export async function exportSong()
try
{
this._exportRMIDI();
} catch (e)
}
catch (e)
{
showNotification(
"Warning",
Expand Down
3 changes: 2 additions & 1 deletion src/website/js/sequencer_ui/sequencer_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ class SequencerUI

}
return this.decoder.decode(text);
} catch (e)
}
catch (e)
{
encodingIndex++;
this.changeEncoding(supportedEncodings[encodingIndex]);
Expand Down
3 changes: 2 additions & 1 deletion src/website/js/sequencer_ui/title_and_media_status.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export function updateTitleAndMediaStatus(cleanOtherTextEvents = true)
playbackRate: this.seq.playbackRate,
position: this.seq.currentTime
});
} catch (e)
}
catch (e)
{

}
Expand Down
3 changes: 2 additions & 1 deletion src/website/server/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export function serveStaticFile(res, filePath, mimeType = undefined)
try
{
file = fs.readFileSync(filePath);
} catch (e)
}
catch (e)
{
res.writeHead(404);
res.end(`
Expand Down

0 comments on commit a4f230e

Please sign in to comment.