[Question]
  [
Inspired by [I'm not the language you're looking for!](https://codegolf.stackexchange.com/questions/55960/im-not-the-language-youre-looking-for)
# Challenge
Choose two different programming languages, and write a program that prints the following line to stdout (or equivalent):
```
This program errors out in <the current language> :P
```
and then generates different kind of error in each of the two languages.
# Rules
Some rules are taken from the original challenge.
* In the output, language names should exactly follow:
	+ The name listed on [TIO](https://tio.run/#), optionally excluding the version number and/or the implementation name (e.g. if you use `JavaScript (Node.js)` as one of your languages, you can use `JavaScript` for your language name, but not `JS` or `Javascript`.)
	+ The full name on the official website (or GitHub repo) if your language of choice is not available on TIO.
* Neither program should take any input from the user.
* You may use comments in either language.
* Two different versions of the same language count as different languages.
	+ If this is done, the program should output the major version number, and if running on two different minor versions, should report the minor version also.
	+ You should not use prebuilt version functions (this includes variables that have already been evaluated at runtime).
* **Two different command line flags in the same language also count as different languages** as per [this meta consensus](https://codegolf.meta.stackexchange.com/questions/14337/command-line-flags-on-front-ends), as long as the flags don't include code fragments (such as `-Dblahblah...` in C).
	+ If this is done, the program should also output the flag used.
* Two errors are considered different unless both errors are generated by the same semantics (such as "division by zero", "segmentation fault", or "index out of range").
	+ If a language's runtime does not exit after an error, but reports the error in some way to the user, it's a valid error.
	+ If a language does not discriminate the error messages but has a known list of reasons that cause error, **you must specify the reason, not the error message.**  
	
	An example is `><>`, which has only one error message `something smells fishy...`, but [esolangs wiki page](https://esolangs.org/wiki/Fish#Errors) has a list of error reasons.
* Syntax error is not allowed unless it is generated by calling `eval()` or similar.
* Throwing something manually (via `throw`(JS), `raise`(Python), `die`(Perl) or similar) is allowed, but all of them are considered as one kind of error.
* Error by invalid command in 2D or golflangs is also allowed (and treated as one kind of error).
# Examples
### Python and Ruby
* Python: `This program errors out in Python :P` to stdout, then undefined identifier
* Ruby: `This program errors out in Ruby :P` to stdout, then index out of bounds
### C89 and C99
* C89: `This program errors out in C 89 :P` to stdout, then division by zero
* C99: `This program errors out in C 99 :P` to stdout, then segmentation fault
Note that the version number should *always* be separated from the language name by a space.
### Python 2.7.9 and Python 2.7.10
* Python 2.7.9: `This program errors out in Python 2.7.9 :P` to stdout, then syntax error on eval
* Python 2.7.10: `This program errors out in Python 2.7.10 :P` to stdout, then key error on dict
### Perl and Perl `-n`
* Perl: `This program errors out in Perl :P` to stdout, then invalid time format
* Perl `-n`: `This program errors out in Perl -n :P` to stdout, then try to open a file that doesn't exist
# Winning condition
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins. But you're always encouraged to post an answer that is fun or interesting even if it isn't very short. 
  
[Answer]
# [Python 2](https://docs.python.org/2/) / [Python 3](https://docs.python.org/3/), 60 bytes
```
print("This program errors out in Python %d :P"%(3/2*2))*1;a
```
* Python 2 got `NameError: name 'a' is not defined`
* Python 3 got `unsupported operand type(s) for *: 'NoneType' and 'int'`
**Python 2:**
* `/` is integer division, 3 / 2 got 1; int(3 / 2 \* 2) is 2.
* print is a statement, so the first statement read as `print((...)*1)`, here `*1` means repeating the string once.
* second statement referenced a non-existing variable, which caused the error.
* [Try it online!](https://tio.run/##K6gsycjPM/r/v6AoM69EQykkI7NYoaAoP70oMVchtagov6hYIb@0RCEzTyEArFRBNUXBKkBJVcNY30jLSFNTy9A68f9/AA "Python 2 – Try It Online")
**Python 3:** 
* '/' is floating number division, 3 / 2 got 1.5; int(3 / 2 \* 2) is 3.
* print is a function, so the first statement read as `(print(...))*1`.
* function `print` returns `None`; Multiplication do not work on `None x int`, so it report "unsupported operand".
* [Try it online!](https://tio.run/##K6gsycjPM/7/v6AoM69EQykkI7NYoaAoP70oMVchtagov6hYIb@0RCEzTyEArFRBNUXBKkBJVcNY30jLSFNTy9A68f9/AA "Python 3 – Try It Online")
[Answer]
# C and C++, ~~114~~ 101 bytes
*-13 bytes thanks to [l4m2](https://codegolf.stackexchange.com/users/76323/l4m2)!*
```
#include<stdio.h>
main(){auto d=.5;printf("This program errors out in C%s :P",d?"++":"");2[&d]+=1/d;}
```
Segmentation fault in C++, floating point exception in C.
`auto` is defaulted to `int` in C so `(int).5` becomes `0`, so trying to divide by it is basically division by zero.
In C++ `1/d` is 2, adding it to address of `d` and trying to change that address' value throws a segfault.
[Try it in C++!](https://tio.run/##Sy4o0E1PTv7/XzkzLzmnNCXVprgkJTNfL8OOKzcxM09DszqxtCRfIcVWz9S6oCgzryRNQykkI7NYoaAoP70oMVchtagov6hYIb@0RCEzT8FZtVjBKkBJJ8VeSVtbyUpJSdPaKFotJVbb1lA/xbr2/38A)  
[Try it in C!](https://tio.run/##S9ZNT07@/185My85pzQl1aa4JCUzXy/Djis3MTNPQ7M6sbQkXyHFVs/UuqAoM68kTUMpJCOzWKGgKD@9KDFXIbWoKL@oWCG/tEQhM0/BWbVYwSpASSfFXklbW8lKSUnT2ihaLSVW29ZQP8W69v9/AA)
[Answer]
# JavaScript + HTML / HTML + JavaScript, 160 bytes
```
<!--
document.write`This program errors out in JavaScript + HTML :P`()
--><script>document.write`This program errors out in HTML + JavaScript :P`+X</script>
```
```
<!--
document.write`This program errors out in JavaScript + HTML :P`()
--><script>document.write`This program errors out in HTML + JavaScript :P`+X</script>
```
Not sure if this count two languages, but it is funny.
[Answer]
# [><>](https://esolangs.org/wiki/Fish) and [Foo](https://esolangs.org/wiki/Foo), 42 bytes
```
#o<"This code errors in "p"Foo"'><>'" :P"/
```
[Try it in ><>!](https://tio.run/##S8sszvj/XznfRikkI7NYITk/JVUhtagov6hYITNPQalAyS0/X0ndzsZOXUnBKkBJ//9/AA "><> – Try It Online")
[Try it in Foo!](https://tio.run/##S8vP//9fOd9GKSQjs1ghOT8lVSG1qCi/qFghM09BqUDJLT9fSd3Oxk5dScEqQEn//38A "Foo – Try It Online")
Foo prints everything in `"`, as is well documented, and tries to divide by zero at the end. It ignores the `'><>'`.
`><>` pushes the "Foo" to the stack, but immediately pops it using `p`. After it prints everything to the stack with `#o<` it exits when the the stack is empty with the only error message it knows, `something smells fishy...`
[Answer]
# Java 8 & C99, 172 bytes
```
//\
interface a{static void main(String[]a){System.out.print("This program errors out in Java 8 :P");a[1]=""/*
main(n){{n=puts("This program errors out in C99 :P")/0/**/;}}
```
Based on my answer for the [*'abc' and 'cba'* challenge](https://codegolf.stackexchange.com/a/138416/52210).
[Try it in Java 8 - resulting in *ArrayIndexOutOfBoundsException: 1*.](https://tio.run/##fY29DoIwFEZ3nuKmE5BIdRMJk5uTCW7IcAMVi@lP2guJaXj2SngA1@/knG/CBQ/GCj0Nnxg5fyZSk3Av7AVg8IQke1iMHECh1GlDTuqx7TALzdeTUIWZqbDbSCl7vKUH68zoUIFwzjgPGwap4bbdwBkud5ZV2J66mjGeJ3tSZyHo2s7k/xauZbnr/MjznFfrGuMP)  
[Try it in C - resulting in *Floating point exception: division by zero is undefined*.](https://tio.run/##fYyxCoMwFAB3v@KRSYWadqsVp26dCnazDo80tQ80keQplOC3p@IHdL3jTh3UgKaPUcpnQoa1e6PSgMEzMilYLL1gRDJpw45M33aYhebrWY@FnbmYNsipeHzIw@Rs73AE7Zx1HjYNZOCGC8IZLneRVdieuloImSf70mQhmHqa2f89XMtyz@VR5rms1jXGHw)
**Explanation:**
```
//\
interface a{static void main(String[]a){System.out.print("This program errors out in Java 8 :P");a[1]=""/*
main(n){{n=puts("This program errors out in C99 :P")/0/**/;}}
```
As you can see in the Java-highlighted code above, the first line is a comment due to `//`, and the C-code is a comment due to `/* ... */`, resulting in:
```
interface a{static void main(String[]a){System.out.print("This program errors out in Java 8 :P");a[1]="";}}
```
So it prints to STDOUT, and then tries to access the second program-argument (when none given), so it produces the *ArrayIndexOutOfBoundsException*.
---
```
//\
interface a{static void main(String[]a){System.out.print("This program errors out in Java 8 :P");a[1]=""/*
main(n){{n=puts("This program errors out in C99 :P")/0/**/;}}
```
Not sure how to correctly enable C-highlighting, because `lang-c` results in the same highlighting as Java.. But `//\` will comment out the next line, which is the Java-code, resulting in:
```
main(n){{n=puts("This program errors out in C99 :P")/0;}}
```
So it prins to STDOUT, and then gives a division by zero error.
[Answer]
# Java 8 & [Whitespace](https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php), ~~439~~ ~~431~~ ~~428~~ 408 bytes
```
                         
                    
                        
             
              
                 
    
      
             
        
             
                
               
             
        
             
         
        
         
   
            
      
        
   
        
 
             
             
         
                 
        
 interface a{static void    main(String[]a){System.out.print("This program errors out"+
" in Java 8 :P");a[0]="";}}
        
    
                
      
             
                
                    
  
                        
        
  
 
```
[Try it in Java 8 - resulting in *ArrayIndexOutOfBoundsException: 0*.](https://tio.run/##XVBBCsIwEDwnr1hyqojFoyh@wJNQb9LDorFGaVLSKEjp2@uabms1OWR2ZjLZ7A2fuHCVtrfzvesARFwyAqAdUU/3UACLfMY6@mDggDkYcuQkgExUiyj3wmiK5PcmcHYvTF7gYkBsHRI49bc9shkbtL/gSQM2dcBgTuLpzFmUaGySBW9sccxx1mSvOugydY@QVkSGRB2upobKu8JjCdp752sgWc2lolTY0QhhBeu9mm3wuMy3Sm3a9tun4L5@ZvQ/FAISxq98eMFjpQ/KrnsD)  
[Try it in Whitespace - resulting in *user error (Can't do Infix Plus)*.](https://tio.run/##XVAxDsIwDJyTV1iZWiFVjIiKDzAhlQ0xWBBohjZVEooQ4u3FJG4ppEPOd5er7XttgvYdnvQwAIh4ZARAX0SJTlAAi3zHOvpg5IA5GHPkLIBMVIsoJ2EyRfL7Ejg7CbM/cDEito4JnPrbHtlMG7S70JiATx8wmJPorTmLBk2bVcGZ9no4Yv6sHj7oprC3UHREhkzta@Ohc/bqsAHtnHUeSFYLqSgVttgjrGC9U3mJh@Vxo1T5en37FNzXz47@l0JAwjTKhxe8VhpQDsMb)
### Explanation:
**Java 8:**
```
interface a{static void main(String[]a){System.out.print("This program errors out"+
" in Java 8 :P");a[0]="";}}
```
So it prints to STDOUT, and then tries to access the first program-argument (when none given), so it produces the *ArrayIndexOutOfBoundsException*.
---
**Whitespace:**
```
[S S T  T   T   T   T   T   N
_Push_-31_P][S S T  T   T   S T S T N
_Push_-53_:][S S T  T   S S T   T   T   T   N
_Push_-79_space][S S T  T   S T S N
_Push_-10_e][S S T  T   T   S S N
_Push_-12_c][S S T  T   T   T   S N
_Push_-14_a][S S S T    N
_Push_1_p][S S S T  S S N
_Push_4_s][S S T    T   S T S N
_Push_-10_e][S S S T    S T N
_Push_5_t][S S T    T   T   S N
_Push_-6_i][S S T   T   T   T   N
_Push_-7_h][S S T   T   T   S S S N
_Push_-24_W][S T    S S T   S T S N
_Copy_0-based_10th_(-79_space)][S S T   T   N
_Push_-1_n][S S T   T   T   S N
_Push_-6_i][S T S S T   S N
_Copy_0-based_2nd_(-79_space)][S S S T  S T N
_Push_5_t][S S S T  T   S N
_Push_6_u][S S S N
_Push_0_o][S T  S S T   T   N
_Copy_0-based_3rd_(-79_space)][S S S T  S S N
_Push_4_s][S S S T  T   N
_Push_3_r][S S S N
_Push_0_o][S S S T  T   N
_Push_3_r][S N
S _Duplicate_top_(3_r)][S S T   T   S T S N
_Push_-10_e][S T    S S T   T   S N
_Copy_0-based_6th_(-79_space)][S S T    T   S N
_Push_-2_m][S S T   T   T   T   S N
_Push_-14_a][S S S T    T   N
_Push_3_r][S S T    T   S S S N
_Push_-8_g][S S S S (_Note_the_additional_S_here)N
_Push_0_o][S S S T  T   N
_Push_3_r][S S S T  N
_Push_1_p][S T  S S T   T   T   N
_Copy_0-based_7th_(-79_space)][S S S T  S S N
_Push_4_s][S S T    T   T   S N
_Push_-6_i][S S T   T   T   T   N
_Push_-7_h][S S T   T   T   S T T   N
_Push_-27_T][N
S S N
_Create_Label_LOOP][S S S T T   S T T   T   T   N
_Push_111][T    S S S _Add][T   N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]
```
Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.  
`[..._some_action]` added as explanation only.
[Try this highlighted version.](https://tio.run/##nVNNa4NAED03v8Jjcgi4mo@2t9KeSjCCgR6CPDa6dIVERVdKf73NRnR3jSahyCL6Zua9NzP7wxPBypxGrK73gRVYuyf1eBP4Vckxdwn8UIPlW54uYOniVQXodbqQ9QsuPHqYPF0AscFMEh10EIWGQB1cgDagLoogVz/1YguUD4joe1xCmOq6nBUSU5ryDN53pOU5C3xJuG1YJ@U9y39hzw@0ZDGILTimXftmqqASjfS2NMXQr@6k8XXxUetty1pghaoF2l82Mp3xUsRgdItRxoERmU5dFCN8I5HeJLDwUeXHJKKCQWQ5pmdodnf@Sv91z1ZjA9Fni9OD6zrgbmBXnvHdpgTWFF4m3XAGGseJSLKUHhGAs4LNHmvM4FXRb27f9HrI9M2b9d87YqDOGrtwL8fYzKFgco4bemBHbLZb39zLfnFCSLhve4m3OJZfTTH4RZIK0BIRpwWNBCsaHm9yzv6sTvl5W3Siuv4D)
Whitespace is a stack-based language that ignores everything except for spaces, tabs and new-lines. Here is the same program in pseudo-code:
```
Push all unicode values of "P: ecapsetihW tuo srorre margorp sihT", minus 111
Start LOOP
  Push 111
  Add the top two stack values together
  Print as character
  Go to the next iteration of the LOOP
```
It will error as soon as it's done printing all values and the stack is empty when it tries to do the *Add* (`TSSS`), which requires two items on the stack.
I've generated the constant `111` with [this Java program](https://tio.run/##fVLva9swEP3ev@K4TxJKTQYrY3ZEaWEfDMsYc/YDujJkV3XUObInXQJh5G/35NqOk230i4Tu3T3dvXdPaqcunx5@tm1RKe9hqYz9fQHQbPPKFOBJUbh2tXmATYBYRs7Y8u4eFO/SAPoAOO23FYEEdTe/T54RYwn8RlWV9h2QWtKldtHy5tuPLzfvP7@bQSrfXCWnLGP6p5ENsccfa8c6PiPTxCxeXc0TI8TQwdSDRJzRrJFjVV@X70lDHvcdRqWm2xDwjB/LAUgG8lX9dW0C0qhC3xqr3L7nZfml4ckx10lGkf61VZVnDb/G7MN3m2FMXLgpqZE0Pg7DbR6ZiyptS1ozDovjrCdt/DP@CeOJkhPNBKchbs6/7M9s70lvonpLUROmocoy7MslipFUYBKkRZEKhBhQvKRGyodv/2Zm5@0/Zx0uwjEs0eDSS9ydxXYQZKdc8AWzDAWzi/k1rjDGDPn5QhTxuFdUn1F1KF8qWkcq98xy/j/nSchi8fptMDFwr4at6XVzmrbOhgwM/mI/y6Ft29XaeGhcXTq1Ae1c7TwECcJYMA0F8cc/), which I've also used for previous ASCII-related challenges I've made in Whitespace. In addition, I've used some copies for the spaces to save bytes.
One important thing to note is the trick I've used to place the Java program within the Whitespace answer. Let me start by explaining how a number is pushed in Whitespace:
`S` at the start: Enable Stack Manipulation;  
`S`: Push what follows as Number;  
`S` or `T`: Positive or Negative respectively;  
Some `S` and/or `T`, followed by an `N`: Number as binary, where `T=1` and `S=0`.
Here some examples:
* Pushing the value 1 will be `SSSTN`;
* Pushing the value -1 will be `SSTTN`;
* Pushing the value 111 will be `SSSTTSTTTTN`.
* Pushing the value 0 can be `SSSSN`, `SSTSN`, `SSSN`, `SSTN`, `SSSSSSSSSSSSN`, etc. (When you use `SSSN` (or `SSTN`), we don't have to specify the binary part, because it's implicitly 0 after we've stated its sign.)
So just `SSSN` is enough for pushing the value `0` (used for the letter `o` in this case). But, to place the Java program in this golfed Whitespace program, I needed an additional space, so the first two `o`s are pushed with `SSSN`, but the third one is pushed with `SSSSN`, so we have enough spaces for the sentence of the Java program.
[Answer]
# [CBM BASIC](https://www.c64-wiki.com/wiki/BASIC#CBM_BASIC) and [6502 machine code](https://en.wikibooks.org/wiki/6502_Assembly) (C64), 142 144 bytes
*Had to add 2 bytes after realizing a syntax error wasn't allowed ....*
---
Hexdump of `.prg` file:
```
01 08 50 08 00 00 8F 5A 49 52 49 41 A9 17 8D 18 D0 A2 30 BD 30 08 20 D2 FF E8
E0 4B D0 F5 A2 30 BD 05 08 20 D2 FF E8 E0 44 D0 F5 A9 0D 20 D2 FF A2 1A 4C 37
A4 22 36 35 30 32 20 4D 41 43 48 49 4E 45 20 43 4F 44 45 20 3A D0 22 20 20 20
20 20 00 8D 08 01 00 97 35 33 32 37 32 2C 32 33 3A 99 22 D4 48 49 53 20 50 52
4F 47 52 41 4D 20 45 52 52 4F 52 53 20 4F 55 54 20 49 4E 20 C3 C2 CD 2D C2 C1
D3 C9 C3 20 3A D0 22 2C 58 AD 50 00 00 00
```
---
**The CBM BASIC view**, as listed in the C64's editor:
```
0 remziriastepgosubinput#new0exp0 dim.clrsavekinput#stepnew0exp<white> dim.clrsavedinput#stepstep
 dim.newl7to"6502 machine code :P"
1 poke53272,23:print"This program errors out in CBM-BASIC :P",x/p
```
[![original listing](https://i.stack.imgur.com/s7Ujz.png)](https://i.stack.imgur.com/s7Ujz.png)
**Attention**: It's impossible to correctly enter this program in the BASIC editor. Don't even **try to *edit*** this program in the BASIC editor, it will crash. Still, it's a runnable BASIC program ;)
---
**The 6502 machine code view**:
```
         01 08                          ; load address
.C:0801  50 08       BVC $080B          ; jump to real start of mc
         ; line number (00 00), REM (8F) and "ziria"
.C:0803  00 00 8F 5A 49 52 49 41
.C:080b  A9 17       LDA #$17
.C:080d  8D 18 D0    STA $D018          ; set upper/lower font
.C:0810  A2 30       LDX #$30
.C:0812  BD 30 08    LDA $0830,X
.C:0815  20 D2 FF    JSR $FFD2          ; print "This program errors ..."
.C:0818  E8          INX
.C:0819  E0 4B       CPX #$4B
.C:081b  D0 F5       BNE $0812
.C:081d  A2 30       LDX #$30
.C:081f  BD 05 08    LDA $0805,X
.C:0822  20 D2 FF    JSR $FFD2          ; print "6502 machine code :P"
.C:0825  E8          INX
.C:0826  E0 44       CPX #$44
.C:0828  D0 F5       BNE $081F
.C:082a  A9 0D       LDA #$0D
.C:082c  20 D2 FF    JSR $FFD2          ; print a newline
.C:082f  A2 1A       LDX #$1A           ; error code for "can't continue"
.C:0831  4C 37 A4    JMP $A437          ; jump to error handling routine
.C:0834  22 ; '"'
         ; "6502 machine code :P"
.C:0835  36 35 30 32 20 4D 41 43 48 49 4E 45 20 43 4F 44 45 20 3A D0
         ; '"', some spaces, and next BASIC line
.C:0849  22 20 20 20 20 20 00 8D 08 01 00 97 35 33 32 37 32 2C 32 33 3A 99 22
         ; "This program errors out in CBM-BASIC :P"
.C:0860  D4 48 49 53 20 50 52 4F 47 52 41 4D 20 45 52 52 4F 52 53 20 4F 55 54
.C:0877  20 49 4E 20 C3 C2 CD 2D C2 C1 D3 C9 C3 20 3A D0
.C:0887  22 2C 58 AD 50 00 00 00
```
---
**[Online demo](https://vice.janicek.co/c64/#%7B"controlPort2":"joystick","primaryControlPort":2,"keys":%7B"SPACE":"","RETURN":"","F1":"","F3":"","F5":"","F7":""%7D,"files":%7B"perr.prg":"data:;base64,AQhQCAAAj1pJUklBqReNGNCiML0wCCDS/+jgS9D1ojC9BQgg0v/o4ETQ9akNINL/ohpMN6QiNjUwMiBNQUNISU5FIENPREUgOtAiICAgICAAjQgBAJc1MzI3MiwyMzqZItRISVMgUFJPR1JBTSBFUlJPUlMgT1VUIElOIMPCzS3CwdPJwyA60CIsWK1QAAAA"%7D,"vice":%7B"-autostart":"perr.prg"%7D%7D)**, type `run` to run as BASIC, `sys 2049` to run as machine code, `list` to show it interpreted as BASIC code.
Running as BASIC produces a `division by zero error in 1`, running as machine code a `can't continue error`
[![screenshot](https://i.stack.imgur.com/qjY9i.png)](https://i.stack.imgur.com/qjY9i.png)
---
**Explanation:**
The first two bytes of a `.prg` file are the load address in little endian, this is `$0801` (decimal `2049`) here, which is the start address for BASIC programs on the C64. `run` starts this program in the BASIC interpreter, while `sys 2049` is the command to run a machine code program at address `2049`.
As you can see, the first line in the BASIC view is a comment (`rem`) containing "garbage" and part of the required output string. This is the machine code program and some filler bytes. You see some "random" BASIC commands there because CBM-BASIC programs contain the commands "tokenized" as single byte values, and some of these values are the same as opcodes used in the machine code. The machine code reuses the string present in the second line of code for its output.
The first two bytes of a line of a basic program are a pointer to the next line, here `$0850`. This is carefully chosen because `50 08` is also a 6502 branch instruction jumping over the next 8 bytes when the overflow flag is not set -- this is used to jump somewhere in the middle of this "comment" line when executed as machine code. The `50` is the opcode used here, so the second line has to start at `0850` for the trick to work. That's why you see a sequence of 5 `20` bytes (space characters) to fill up. The machine code actively jumps to the ROM error handling routine to give a "can't continue" error.
The BASIC code is pretty straightforward; as a second argument to "print", two uninitialized variables (having a value of `0` in CBM BASIC) are divided, triggering the "division by zero" error.
[Answer]
# C and Python, ~~126~~ 116 bytes
*-10 bytes thanks to @Bubbler!*
```
#1/*
-print("This program errors out in Python :P")
'''*/
main(c){c=puts("This program errors out in C :P")/0;}//'''
```
In Python print() is a None, so trying to get its negative doesn't make sense, so Python throws an error.
In C printf() returns an int, so dividing it by zero gives a floating point exception.
[Try it in C!](https://tio.run/##S9ZNT07@/1/ZUF@LS7egKDOvREMpJCOzWKGgKD@9KDFXIbWoKL@oWCG/tEQhM08hoLIkIz9PwSpASZNLXV1dS58rNzEzTyNZszrZtqC0pBivZmewPn0D61p9faDm//8B)  
[Try it in Python!](https://tio.run/##K6gsycjPM/7/X9lQX4tLt6AoM69EQykkI7NYoaAoP70oMVchtagov6hYIb@0RCEzTyEArEHBKkBJk0tdXV1Lnys3MTNPI1mzOtm2oLSkGK9mZ7A@fQPrWn19oOb//wE)
[Answer]
# [Attache](https://github.com/ConorOBrien-Foxx/attache) + [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 82 bytes
```
s:="Attache"
s=" Mathematica "
Throw[Print["This program errors out in",s,":P"]-0]
```
[Try Attache online!](https://tio.run/##JccxCoAwDADA3VeEzBWchQ4@QHBwkw5Bis3QVpKIz4@Dtx2Z0Vmyu84Rlz84aERYyUquZHwS4LAX6e@xCTc7cC@scEu/hCpkkS4K/THghkEDzhumcUruHw "Attache – Try It Online") [Try Mathematica online!](https://tio.run/##RckxCoAwDADA3VeEzArOQgcfIDi4SYcgxWSokSTi8@vorVcpuFQKOag1nxLOEXRwwc4TwvIvYLex6buvJlfsuLE43KanUYVipuagT4Bc2HuP04p5GHNrHw "Wolfram Language (Mathematica) – Try It Online")
This pivots upon the meaning of the operator `=` in the two languages. In Attache, it compares for equality, but in Mathematica, it performs variable assignment. `:=` does variable assignment in both languages.
Now, in Attache, `Print` returns an array of strings printed, and subtraction is not possible with strings and integers (namely, `0`). So, a type error is thrown. In Mathematica, `Print` returns `Null`, and Mathematica is just fine subtracting `0` from that. But, we manually throw that null with `Throw`, giving a `nocatch` error.
[Answer]
# [Python (2)](https://docs.python.org/2/) and [QB64](http://qb64.net), 82 bytes
```
1#DEFSTR S
s="QB64"
'';s="Python"
print"This program errors out in "+s+" :P"
CLS-1
```
To test the Python version, you can [Try it online!](https://tio.run/##K6gsycjPM/r/31DZxdUtOCRIIZir2FYp0MnMRIlLXd0ayA4AK1HiKijKzCtRCsnILFYoKMpPL0rMVUgtKsovKlbILy1RyMxTUNIu1lZSsApQ4nL2CdY1/P8fAA "Python 2 – Try It Online") To test the QB64 version, you'll need to download QB64.
### What Python sees
```
1#DEFSTR S
s="QB64"
'';s="Python"
print"This program errors out in "+s+" :P"
CLS-1
```
The first line is just the bare expression `1` (a no-op) followed by a comment.
The second line sets `s` to the string `"QB64"`, but the third line immediately changes it to `"Python"`. The fourth line prints the message accordingly.
The fifth line is another bare expression, but it raises a `NameError` because of the undefined name `CLS`.
### What QB64 sees
```
1#DEFSTR S
s="QB64"
'';s="Python"
print"This program errors out in "+s+" :P"
CLS-1
```
The first line, numbered `1#`, defines every variable whose name starts with `S` (case-insensitive) as a string variable. This means we don't have to use `s$`, which would be a syntax error in Python.
The second line sets `s` to the string `"QB64"`. `'` starts a comment in QB64, so the third line doesn't do anything. The fourth line prints the message accordingly.
The fifth line tries to `CLS` (clear screen) with an argument of `-1`. But since `CLS` only accepts arguments of `0`, `1`, or `2`, this produces the error `Illegal function call`. The error creates a dialog box asking the user if they want to continue execution or abort. Technically, this means the error isn't fatal (in this case, you can pick "continue execution" and the program simply ends without further problems); but the OP has explicitly allowed languages that can continue after an error, so QB64's behavior should be fine.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly) and [M](https://github.com/DennisMitchell/m), 39 bytes
```
İ=`ị“¢³ƥ“Ȥ¹»;“ :P”“¢ḅñ⁵ẹḞŀẊịñṙȧṄɱ»;ȮṠṛƓ
```
[Try it in Jelly!](https://tio.run/##y0rNyan8///IBtuEh7u7HzXMObTo0OZjS4GME0sO7Ty02xrIUrAKeNQwFyz3cEfr4Y2PGrc@3LXz4Y55Rxse7uoCaju88eHOmSeWP9zZcnIjUMuJdQ93Lni4c/axyf//AwA "Jelly – Try It Online")
[Try it in M!](https://tio.run/##y/3//8gG24SHu7sfNcw5tOjQ5mNLgYwTSw7tPLTbGshSsAp41DAXLPdwR@vhjY8atz7ctfPhjnlHGx7u6gJqO7zx4c6ZJ5Y/3NlyciNQy4l1D3cueLhz9rHJ//8DAA "M – Try It Online")
Both languages apply inverse `İ` to `0` which results in `inf` for Jelly and `zoo` for M. I don't know why `zoo` represents infinity in M. Ask Dennis.
The important difference is that Jelly's infinity is equal to itself while M's infinity is not. Thus the "is equal to itself" monad `=`` yields `1` in Jelly and `0` in M. From here:
```
İ=`ị“¢³ƥ“Ȥ¹»;“ :P”“¢ḅñ⁵ẹḞŀẊịñṙȧṄɱ»;ȮṠṛƓ
İ=`                                      0 in M, 1 in Jelly
    “¢³ƥ“Ȥ¹»                             Pair of compressed strings: [' M',' Jelly']
   ị                                     Index into this list with 0 or 1
            ;“ :P”                       Concatenate with the string ' :P'
                  “¢ḅñ⁵ẹḞŀẊịñṙȧṄɱ»       Compressed string: 'This program errors in'
                                  ;      Prepend this to ' Jelly/M :P'
                                   Ȯ     Print the string and return it
                                    Ṡ    Sign. M errors with a string as input and terminates
                                         Jelly returns a list of Nones
                                     ṛ   Right argument. This prevents the list of Nones from being printed
                                      Ɠ  Read a single line from input. Since input is not allowed, this produces an EOFError
```
Jelly's error is `EOFError: EOF when reading a line`.
M's error is `TypeError: '>' not supported between instances of 'str' and 'int'`.
[Answer]
# [C++ 14 (gcc) / C++ 17 (gcc)](https://gcc.gnu.org/), ~~107~~ 105 bytes
```
#include<cstdio>
int*p,c=*"??/0"/20;int
main(){*p=printf("This program errors out in C++ 1%d :P",4+c)/c;}
```
[Try it online! (C++14)](https://tio.run/##Dc0xDoMgFIDh3VO80DRR0KCNUy116AU69ALkoZREgQBOTa9eyvh/y4/edxox55OxuB1quWFMyrh7ZWyivkVByTzznvBLPxWqdmls3XyoFz6UXmvyepsIPjgd5A5LCC5EcEcCY@HBGAxnBdcnaUeGDcfpm/MP103qmLtyEsjYMP4B "C++ (gcc) – Try It Online")
[Try it online! (C++17)](https://tio.run/##Dc0xDsIgFIDhvad4wZi00IbWmJhYsYMXcPAC5NEiSQsE6GS8usj4f8uP3ncaMeeDsbjuar5hTMq4e2Vsor5FQck08Z7wUz8WqjZpbN18qBc@lF5q8nqbCD44HeQGcwguRHB7AmPhwRgMRwXXJ2nPDBuO4zfnHy6r1DF35SSQseHyBw "C++ (gcc) – Try It Online")
---
Assumes that `<cstdio>` declares `printf` in the global namespace (in addition to `std`) and that the basic execution character set uses ASCII values, which are both true using g++ on Linux.
The basic catch here is that C++17 eliminated trigraphs from the language.
In C++14, `"??/0"` contains a trigraph and is equivalent to `"\0"`. So `*"??/0"` is zero, and `c` is set to zero. The number 4 is passed as an argument to `printf`, then the division by `c` causes undefined behavior. On Linux, this happens before `*p` comes into the picture, and the program gets a `SIGFPE`.
In C++17, `"??/0"` is exactly the length 4 string it appears to be. So `*"??/0"` is `'?'` or 63, and `c` is set to 3. The number 7 is passed as an argument to `printf`, and this time the division by `c` is valid. Since `p` is a namespace member, it gets zero-initialized at the start of the program and has a null pointer value, so `*p` is undefined behavior. On Linux, because the program attempts to modify memory at address zero, the program gets a `SIGSEGV`.
[Answer]
# [Perl 5](https://www.perl.org/) and [JavaScript (Node.js)](https://nodejs.org), 96 bytes
```
eval("printf=console.log");printf("This program errors out in %s :P",("Perl","JavaScript"));$//0
```
This makes use of the fact that `(...)` is a list in Perl that `printf` will use the leftmost element of and the fact that it's the comma operator in JavaScript, which will return the rightmost argument.
Causes a division by zero error in Perl and a ReferenceError because `$` is not defined in JavaScript.
[Try the Perl online!](https://tio.run/##JcxBCsIwEADAryyLQgK1jYdeLP2AIBTqB0KJdSFmwyb2@W4LXucwOUjsVcPmo8EslOprXDgVjqGNvKId/mjw@aYCWXgV/4EgwlKAvxUowbnAbcLG4HRs2ODdb35ehHJFa4dT1znVH@dKR6yXR9@6q9sB "Perl 5 – Try It Online")
[Try the JavaScript online!](https://tio.run/##JcxLCsIwEADQqwyDhQT6W1t6AVeBeoFQpzWSZsJM7PWj6PYt3sufXlcJuXSJH1QrnT4azBJS2eaVk3KkPvKOdvqjwfszKGThXfwBJMKiwO8CIUGjcHXYGnQkEVu8ffvl16O102UYxlo/ "JavaScript (Node.js) – Try It Online")
[Answer]
# [Octave](https://www.gnu.org/software/octave/) and MATLAB, 67 bytes
```
v=ver;disp(['This program errors out in ' v(1).Name ' :P']);v(--pi)
```
[Try it online!](https://tio.run/##y08uSSxL/f@/zLYstcg6JbO4QCNaPSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPQV2hTMNQU88vMTcVyLYKUI/VtC7T0NUtyNT8/x8A "Octave – Try It Online")
Notes: The code assumes MATLAB is installed with no toolboxes (or that the names of any toolbox that is installed don't start with letters A to M).
How it works:
The code gets the version data for the interpreter and toolboxes using `ver`. Running `v(1).Name` extracts the name of the first product, this will return either `Octave` or `MATLAB` assuming the note above holds true.
The program will then display the required string, complete with `Octave` or `MATLAB` as required.
Finally we do `v(--pi)`. 
In Octave, `--` is the pre-decrement operator. As such it attempts to pre-decrement which fails as the variable `pi` doesn't exist (`pi` is actually function, not a variable).
```
This program errors out in Octave :P
error: in x-- or --x, x must be defined first
```
In MATLAB, the pre-decrement operator doesn't exist. As such the statement is interpreted as `v(-(-pi))` which is equal to just `v(pi)`. However `pi` is not an integer, so cannot be used to index into the `v` array, giving an error.
```
This program errors out in MATLAB :P
Subscript indices must either be real positive integers or logicals.
```
[Answer]
# Haskell, Python3, JavaScript(Node.js), 195 Bytes
```
j=1
y="This program errors out in "
--j//1;Error=print
--j;Error(y+"Python :P");eval("console.log(y+`JavaScript :P`);e");j//2;"""
1//0=do print (y++"Haskell :P");putChar$""!!1
main=1//0
--j //"""
```
Error Messages
Python - Syntax Error due to the ` in the EVAL
Haskell - Index too large (""!!1)
JavaScript - Reference Error (e is not defined)
[Answer]
# [Perl 5](https://www.perl.org/) and [Perl 6](https://github.com/nxadm/rakudo-pkg), 55 bytes
```
say('This program errors out in Perl ',5-~-1,' :P').a/0
```
[Try Perl 5 online!](https://tio.run/##K0gtyjH9/784sVJDPSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPIQCoTEFdx1S3TtdQR13BKkBdUy9R3@D//3/5BSWZ@XnF/3V9TfUMDA0A "Perl 5 – Try It Online") (Illegal division by zero)
[Try Perl 6 online!](https://tio.run/##K0gtyjH7/784sVJDPSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPIQCoTEFdx1S3TtdQR13BKkBdUy9R3@D/fwA "Perl 6 – Try It Online") (No such method)
Prefix `~` is stringification in Perl 6 and essentially a no-op in the program above. In Perl 5, it's bitwise not, converting -1 to 0.
`.` is method call syntax in Perl 6 and concatenation in Perl 5.
[Answer]
# [C (gcc)](https://gcc.gnu.org/)/[Stax](https://github.com/tomtheisen/stax), 109 bytes
```
AA=~1;
	char* s;main(){*(int*)(printf("%s C :P",s))=0;}char* s=
"This program errors out in";;;/*dp`UGYC\`Q*/
```
[Try it online! (C (gcc))](https://tio.run/##S9ZNT07@/9/R0bbO0JqLMzkjsUhLodg6NzEzT0OzWksjM69ES1OjoAhIp2koqRYrOCtYBSjpFGtq2hpY10KV23IphWRkFisUFOWnFyXmKqQWFeUXFSvkl5YoZOYpWVtb62ulFCSEukc6xyQEaun//w8A "C (gcc) – Try It Online")
[Try it online! (Stax)](https://tio.run/##Ky5JrPj/39HRts7QmoszOSOxSEuh2Do3MTNPQ7NaSyMzr0RLU6OgCEinaSipFis4K1gFKOkUa2raGljXQpXbcimFZGQWKxQU5acXJeYqpBYV5RcVK@SXlihk5ilZW1vra6UUJIS6RzrHJARq6f//DwA "Stax – Try It Online") or [Run and debug it! (Stax)](https://staxlang.xyz/#c=AA%3D%7E1%3B%0A%09char*+s%3Bmain%28%29%7B*%28int*%29%28printf%28%22%25s+C+%3AP%22,s%29%29%3D0%3B%7Dchar*+s%3D%0A%22This+program+errors+out+in%22%3B%3B%3B%2F*dp%60UGYC%5C%60Q*%2F&a=1)
Segfault in C. Invalid operation in Stax. I love how everything that is not a comment is actually used in Stax.
## C
This is how C sees it. The first line is no-op. The second line prints the message with `printf` and then segfaults due to the `=0`.
```
AA=~1;
	char* s;main(){*(int*)(printf("%s C :P\n",s))=0;}char* s=
"This program errors out in";;;/*dp`UGYC\`Q*/
```
## Stax
Stax program terminates whenever it tries to pop or peek from empty stack. This makes it a little bit tricky and we have to prepare a stack that is not empty. `AA=~1;` does this while remaining a valid statement in C.
```
AA=~1;
AA=       10=10, returns a 1
   ~      Put it on the input stack
    1     Pushes a 1 to main stack (*)
     ;    Peek from the input stack (**)
```
What is really useful is the `~`, it prepares a non-empty input stack so that the `;` can be executed without exiting the program. However, the two `1`s on the main stack are also used later.
The second line begins with a tab and starts a line comment in Stax.
```
"...";;;/*dp`UGYC\`Q*/
"..."                     "This program errors out in"
     ;;;                  Peek the stack three times so that we have enough operands for the next two operations
        /                 Divide, this consumes one element of the main stack
         *                Multiply, this consumes another element
          d               Discard the result, now the TOS is the string
           p              Pop and print without newline
            `UGYC\`       Compressed string literal for " Stax :P"
                   Q      Print and keep the string as TOS
                    *     Duplicate string specific times
                          Since the element under the top of stack is `1` that was prepared in (**), this does nothing
                     /    Invalid operation error
```
The invalid operation is trying to perform `/` operation for a string as the TOS (2nd operand) and the number `1` from (\*) as the 1st operand, which is invalid.
If the two operands are swapped, it would be a valid operation in Stax.
[Answer]
# [Foo](https://esolangs.org/wiki/Foo) / [CJam](https://sourceforge.net/projects/cjam/), ~~51~~ 50 bytes
```
"This program errors out in ""Foo"/'C'J'a'm" :P"Li
```
This exits with a divide-by-zero error in Foo, and a `NumberFormatException` in CJam.
## To CJam:
* A string literal (between quotes) pushes itself to the stack. Items from the stack are automatically printed without a separator when the program terminates.
* `/` tries to split the string `This program errors out in`  on the substring `Foo`. Since the string does not contain the substring, this yields a singleton array containing the original string, which displayed in exactly the same way.
* `'x` is a character literal for `x`, which is printed the same way as a one-character string. This way, we can push data for CJam that is ignored by Foo (I haven't figured out how to make a loop not execute in Foo).
* `Li` tries to cast the empty string to an integer, which fails. Everything from the stack is printed.
## To Foo:
* A string literal (between quotes) prints itself.
* `/` tries to divide the current cell by the top stack element (which is an implicit `0`). For some reason, divide-by-0 errors aren't fatal in Foo, so this just prints the message
```
Only Chuck Norris can divide by zero.
```
to STDERR and keeps going.
* Unrecognized characters (`'C'J'a'm` and `Li`) are ignored.
[Answer]
# [Python](https://docs.python.org/3/) and [Lua](https://www.lua.org/manual/5.3/), ~~111~~ ~~110~~ ~~102~~ ~~98~~ ~~95~~ 85 bytes
```
x="This program errors out in ",#[[
print(x[0]+"Python :P")
a#]]z=#print(x.."Lua :P")
```
Errors:
Python 3: 
```
Traceback (most recent call last):
  File ".code.tio", line 3, in <module>
    a#]]z=#print(x.."Lua :P")
NameError: name 'a' is not defined
```
Lua:
```
lua: .code.tio:3: attempt to get length of a nil value
stack traceback:
    .code.tio:3: in main chunk
    [C]: in ?
```
Clearly distinct.
Abuses multiple differences:
* `<var>=<a>,<b>,...` creates a tuple in Python, but in Lua it creates an argument list, from which only the first member is taken.
* `#` starts a comment in Python, but is the length operator in Lua. Extra props to Python for allowing tuples to end in a comma.
* `[[...]]` is Lua's multiline string syntax, meaning it doesn't even see Python's print function; this is necessary due to Lua using `..` for string concatenation and not `+`.
* Python errors after seeing `a`, an undefined variable; Lua after `z=#print(x.."Lua :P")`. Using just `#print(x.."Lua :P")` for Lua doesn't work, as that raises an error before the code is even executed.
Edits:
* No need to use `"".join` in Python, -1 byte
* Make `x` a string in both languages and place `Python` in a string literal in the print function, -8 bytes
* Using `#[[]]` is shorter than `#""` and `--[[]]`, -4 bytes
* No need to use `#1` as a table key, -3 bytes
* [Jo King](https://codegolf.stackexchange.com/users/76162/jo-king) did [this](https://tio.run/##K6gsycjPM/7/v8JWKSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPQUlHOTqaq6AoM69EoyLaIFZbKQCsUcEqQEnTOlE5NhYqp6en5FOaCBauslU2/P8fAA), -9 bytes
* Taking the length of the return value of `print(x.."Lua :P")` works, apparently; -1 byte
[Answer]
# Java and C# ~~242~~ 235
```
/**\u002f/*/using System;/**/class G{public static void/**\u002fmain/*/Main/**/(String[]a){String s="This program errors out in ";/**\u002fSystem.out.print(s+"Java :P");/*/Console.Write(s+"C# :P")/**/;s=/**\u002f(1/0)+""/*/a[-1]/**/;}}
```
Abusing different escape handling between java and C# (unicode escapes are parsed before code parsing in java and not in c#) as a sort of preprocessor, thats the job of the `\u0027` magic, rest are some "toggle-comments"
Edit: Golfed off 8 bytes thanks to a pointer of @KevinCruijssen
Edit: Rule derp fixed
[Answer]
# [AutoHotKey](https://autohotkey.com/docs/AutoHotkey.htm) / C#, ~~155~~ ~~133~~ ~~128~~ 122 bytes
Syntax highlighting explains it better than I could:
**C#** RuntimeBinderException: 'Cannot invoke a non-delegate type'
```
;dynamic
i="This program errors out in " ;Console.Write(i+"c# :P");i();/*
i:=SubStr(i,2,27)
send %i%AutoHotkey :P
Throw */
```
**AutoHotkey** Error: An exception was thrown.
```
;dynamic
i="This program errors out in " ;Console.Write(i+"c# :P");i();/*
i:=SubStr(i,2,27)
send %i%AutoHotkey :P
Throw */
```
## Edits:
1. removed a var
2. -5 bytes thanks to [milk](https://codegolf.stackexchange.com/users/58106/milk)
[Answer]
# PHP 7+ / JavaScript, ~~90~~ 89 bytes
This uses 2 languages with very similar syntax, allowing to write this code on both languages.
The language separation is done by a property not present in JavaScript: PHP considers `[]` (empty array) to be a falsy value while it is truthy in JavaScript (because it is an object and objects are **always** truthy, even `new Boolean(false)`).
```
$X='This program errors out in %s :P';([]?console.log($X,'JavaScript'):printf($X,PHP))();
```
---
## Execution:
Will focus on the following piece of code: `([]?console.log($X,'JavaScript'):printf($X,PHP))();`.
The string attribution works the same in both languages.
This code uses the "ternary operator" ([Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator), [PHP](http://php.net/manual/en/language.operators.comparison.php#language.operators.comparison.ternary)), which works mostly the same way in both languages.
### Javascript
Javascript will run the `console.log($X,'JavaScript')` piece, which returns `undefined`.
Later on, when you try to execute `(...)()`, you get an `Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function` (in Google Chrome).
### PHP
PHP will execute the `printf($X,PHP)` piece.
In PHP, the [`printf`](http://php.net/manual/en/function.printf.php) function [returns the length of the output](http://php.net/manual/en/function.printf.php#refsect1-function.printf-returnvalues).
PHP has an interesting functionality: it can execute functions who's name is stored in a variable (or, since PHP7, as the result of an expression), which prevents a syntax error.
PHP then will try to run the function who's name is the result of the expression `[]? ... :printf($X,PHP)` (which is the number `33`).  
But that interesting functionality has a caveat: only accepts strings (duh!).
This causes a `Fatal error: Function name must be a string`, because `33` is an `int`.
---
Thanks to [Shieru Asakoto](https://codegolf.stackexchange.com/users/71546/shieru-asakoto) for saving me 1 byte!
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E) and [Python 3](https://docs.python.org/3/), 89 bytes
```
print("\"}\"This program errors out in Python :P\""[3:-1]);'")н”±¸ :P\”"05AB1E :P":,õι';a
```
[Try it online! (05AB1E)](https://tio.run/##yy9OTMpM/f@/oCgzr0RDKUapNkYpJCOzWKGgKD@9KDFXIbWoKL@oWCG/tEQhM08hoLIkIz9PwSogRkkp2thK1zBW01pdSfPC3kcNcw9tPLQDJANkKhmYOjoZugJ5SlY6h7ee26lunfj/PwA "05AB1E – Try It Online")
[Try it online! (Python 3)](https://tio.run/##K6gsycjPM/7/v6AoM69EQylGqTZGKSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPIQCsXsEqIEZJKdrYStcwVtNaXUnzwt5HDXMPbTy0AyQDZCoZmDo6GboCeUpWOoe3ntupbp34/z8A "Python 3 – Try It Online")
## [05AB1E](https://github.com/Adriandmen/05AB1E)
```
print("\"}\"This program errors out in Python :P\""[3:-1]);'")н”±¸ :P\”"05AB1E :P":,õι';a  # full program
print("\"}\                                                                                # a bunch of nops
           "This program errors out in Python :P\"                                         # push literal (in 05AB1E, backslashes are not escape characters)
                                                  "[3:-1]);'"                              # push literal
                                                                                  :        # replace all instances of...
                                                               ”±¸ :P\”                    # "Python :P\"
                                                                                  :        # in...
                                                              н                            # first element of...
                                                             )                             # stack as a list (left of list is bottom of stack)...
                                                                                  :        # with...
                                                                       "05AB1E :P"         # literal
                                                                                   ,       # output explicitly to prevent the error from stopping implicit output
                                                                                     ι     # attempt to use...
                                                                                    õ      # empty string...
                                                                                     ι     # as index "step" value in uninterleave, resulting in an error
```
## Error
```
** (RuntimeError) Could not convert  to integer.
    (osabie) lib/interp/functions.ex:101: Interp.Functions.to_integer!/1
    (osabie) lib/interp/commands/special_interp.ex:113: Interp.SpecialInterp.interp_step/3
    (osabie) lib/interp/interpreter.ex:127: Interp.Interpreter.interp/3
    (osabie) lib/osabie.ex:62: Osabie.CLI.main/1
    (elixir) lib/kernel/cli.ex:105: anonymous fn/3 in Kernel.CLI.exec_fun/2
```
## [Python 3](https://docs.python.org/3/)
```
print("\"}\"This program errors out in Python :P\""[3:-1]);'")н”±¸ :P\”"05AB1E :P":,õι';a  # full program
print("\"}\"This program errors out in Python :P\""                                        # print string "}"This program errors out in Python :P" (including quotes)...
                                                   [3:-1]);                                # not including the first 3 characters and the quote at the end
                                                           '")н”±¸ :P\”"05AB1E :P":,õι';   # string literal (nop)
                                                                                        a  # references an undefined variable, resulting in an error
```
## Error
```
Traceback (most recent call last):
  File ".code.tio", line 1, in <module>
    print("\"}\"This program errors out in Python :P\""[3:-1]);'")”±¸ :P\”"05AB1E :P":,õι';a
NameError: name 'a' is not defined
```
[Answer]
# [Forth (gforth)](http://www.complang.tuwien.ac.at/forth/gforth/Docs-html/) and Vim, 76 bytes
```
.( This program errors out in Forth :P ) <esc>0iThi<esc>:s/F.*/Vim :P<cr>:!a
```
[Try it in Forth!](https://tio.run/##S8svKsnQTU8DUf//62kohGRkFisUFOWnFyXmKqQWFeUXFSvkl5YoZOYpuIEUKVgFKGgq2KQWJ9sZZAIVg1lWxfpuelr6YZm5QGmb5CI7K8XE//8B)
[Try it in Vim!](https://tio.run/##K/v/X09DISQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPwS2/qCRDwSpAQVPBJrU42c4gE6gYzLIq1nfT09IPy8wFStskF9lZKSb@//9ftwwA "V (vim) – Try It Online")
In Forth, `.( This program errors out in Forth )` prints the necessary message and the rest just makes it blow up because it's an undefined word.
In Vim, that first part writes `s program errors out in Forth :P )`  to the buffer, `0iThi` puts `Thi` at the start of the line, and `:s/F.*/Vim` turns that last part into `Vim :P` instead of `Forth :P )`. `:!a` simply tries to run a command named `a` and errors because it doesn't exist.
[Answer]
# Perl 5 and C, 95 bytes
```
//;$_='
main(){puts(puts("This program errors out in C :P"));}//';/T.*n /;print$&,"perl :P";die
```
`//;` is basically a NOP in perl, and is a comment in C.
So the C program is effectively:
```
main(){puts(puts("This program errors out in C :P"));}
```
Which prints the required string, then tries to run `puts(32)`. This is technically undefined behavior in C, but it causes a segmentation fault on TIO and every system I have access to.
The perl program treats the whole C program as a string, uses the regex `/T.*n /` to match `This program errors out in`  and then prints that and `perl :P`. `die` causes the program to crash with the error `Died at script_name line 2`.
If you don't like that as an error, `1/0` is the same length and crashes with an `Illegal division by zero` error. I just like `die` more ;)
[Try it online! (C)](https://tio.run/##S9ZNT07@/19f31ol3ladKzcxM09Ds7qgtKRYA0wohWRkFisUFOWnFyXmKqQWFeUXFSvkl5YoZOYpOCtYBShpalrX6uurW@uH6GnlKehbFxRl5pWoqOkoFaQW5YAUWKdkpv7/DwA)
[Try it online! (Perl)](https://tio.run/##K0gtyjH9/19f31ol3ladKzcxM09Ds7qgtKRYA0wohWRkFisUFOWnFyXmKqQWFeUXFSvkl5YoZOYpOCtYBShpalrX6uurW@uH6GnlKehbFxRl5pWoqOkoFQBNBimwTslM/f8fAA)
[Answer]
## VBScript, JScript, 72 bytes
```
x="VB"
'';x='J'
WScript.echo("This program errors out in "+x+"Script")
y
```
VBScript will print "Microsoft VBScript runtime error: Type mismatch: 'y'"  
JScript will print "Microsoft JScript runtime error: 'y' is undefined"
[Answer]
# JavaScript & Python 3, ~~105~~ 91 bytes
Errors by `NameError: name 'console' is not defined` in Python 3
```
a="This program errors out in %s :P"
1//2;print(a%"Python 3")
console.log(a,"JavaScript")()
```
[Try it online!](https://tio.run/##HctBCoAgEADAe69YFgSFKKpb0Qc6BfWBJaIEc2W1oNcbNPcJbzrZdznTiOtpIwThQ@iCXYQlAt8JrAcVoZ@xaOq6HYJYnzQpnP8LHZpiYx/Z7ZXjQ1OJEz20bGJDQqNNzh8 "Python 3 – Try It Online")
... and by `TypeError: console.log(...) is not a function` in JavaScript.
```
a="This program errors out in %s :P"
1//2;print(a%"Python 3")
console.log(a,"JavaScript")()
```
[Try it online!](https://tio.run/##HcxRCoMwDADQf08RAkILm6L@bXiBfQnuAkGLdrikJN1gp@/G3gHeg95ki8aUzyxrKIVGvO/RIKlsSk8IqqIG8soQGWqDy4RV17b9NWnk7KjG6ZN3YRjQV4uwyRGaQzZHJ7z99vm/o3e@lC8 "JavaScript (Node.js) – Try It Online")
[Answer]
# Java (JDK)/JavaScript (Node.js), 154 bytes
```
class P{P(){var s="This program errors out in ";try{System.out.printf("%sJava :P",s);}finally{if(1!='1'){var a=0/0;}throw new Error(s+"JavaScript :P");}}}
```
[Try it online! (Java)](https://tio.run/##Lc9Na4NAEAbgs/6K6ULISts0uVY89lIoCPZWcpgaNZPqrsxsDLLsb7cryWlgPh7eueCEr5fT37LUPYpA6Uud@QkZpFDfZxIY2XaMAzTMlgXs1QEZULnj2VezuGbYxd5uZDKu1Wojn5GE91K9SJaHlgz2/eyp1YenYnvY3nEs9m/7PLgz2xuY5gYfq67lWa3XVc00utWIQgiPaF9IxqfJeP3tqQZx6GKZLJ1giBNduZig@zkCcidZXExWN36Tp0lIw/IP "Java (JDK) – Try It Online")
[Try it online! (JavaScript)](https://tio.run/##Jc5BDoIwEAXQvacYmxggKsJW0qUbVyR4gaJFaqAlMxVCSM9eKa4m@Zn/8j9iFPRENdizNi/p/bMTRFAuZZwso0Agzh6tIhjQvFH0IBENEpivBaWBFRbnpZrJyj5ds3RApW0TswPdVxmuJTtRUrhGadF186KaON/zKI/@uODZJSucbdFMoOUEt6DHdGShXW27grEKzvnQqIFvj@u8Ylen4fgf "JavaScript (Node.js) – Try It Online")
Output in Java:
```
This program errors out in Java :P
Exception in thread "main" java.lang.ArithmeticException: / by zero
    at P.(Main.java:1)
```
Output in JavaScript (to stderr):
```
Error: This program errors out in JavaScript :P
    at P (/home/runner/.code.tio:1:185)
```
This takes advantage of JavaScript's weak typing (`1=='1'`) to detect the language, and the same keywords in Java and JavaScript (`var`,`class`), and the similar error constructors (`new Error()`) to make the polyglot.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell) v6 and PowerShell v2, 73 bytes
```
"This errors out in PowerShell v$($PSVersionTable.PSVersion) :P"
1-shl1/0
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfn/XykkI7NYIbWoKL@oWCG/tEQhM08hACQfDJJXKFPRUAkIDgMqz8zPC0lMyknVg3M1FawClLgMdYszcgz1Df7/BwA "PowerShell – Try It Online")
This will throw a parsing error on v2 because `-shl` was introduced in v3. v3+ will then be able to correctly shift the value before attempting to divide it by 0, conveniently throwing a division-by-zero error. Both versions have the $PSVersionTable hashmap which contains the `PSVersion` field
[Answer]
# Python 3 / [Befunge-98 (FBBI)](https://github.com/catseye/FBBI), 75 bytes
```
r='=,k1'"This program errors out in Befunge :P"
-print(r[4:31]+"Python :P")
```
Raises a TypeError in Python and a segmentation fault in Befunge.
[Try it online! (Python)](https://tio.run/##K6gsycjPM/7/v8hW3VYn21BdKSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPwSk1rTQvPVXBKkCJS7egKDOvRKMo2sTK2DBWWykAbBBISvP/fwA)
[Try it online! (Befunge)](https://tio.run/##S0pNK81LT9W1tPj/v8hW3VYn21BdKSQjs1ihoCg/vSgxVyG1qCi/qFghv7REITNPwQmiXsEqQIlLt6AoM69EoyjaxMrYMFZbKaCyJCM/DySl@f8/AA)
## Python
```
r='=,k1'"This program errors out in Befunge :P"
r=                                                        #Declare variable
  '=,k1'                                                  #String literal
        "This program errors out in Befunge-98 (FBBI) :P" #Another string literal
                                                          #Concatenating string literals joins the two strings together.
-print(r[4:31]+"Python :P")
                                                  
       r[4:31]                                            #Extract the relevant part of the output
              +"Python :P"                                #Change the language name to "Python"
 print(                   )                               #Print the string and return None
-                                                         #Unary negation
```
Apparently, consecutive string literals (such as `'1'"2"`) are valid in Python.
The `print` function, after printing its input (`"This program errors out in Python :P"`), returns `None`. The program attempts to negate that with `-`, which raises a TypeError:
```
Traceback (most recent call last):
  File ".code.tio", line 2, in <module>
    -print(r[4:31]+"Python :P")
TypeError: bad operand type for unary -: 'NoneType'
```
## Befunge
```
r  =,k1'"This program errors out in Befunge :P"
r                                               #Reverse direction
        "This program errors out in Befunge :P" #String literal (backwards)
      1'                                        #Push 49
     k                                          #Repeat that many (49) times:
    ,                                           #Output the last character
   =                                            #System-execute the top of the stack ("")
```
After using `'1k,` to print `"This program errors out in Befunge :P"`, the stack is empty. `=` does a system-execute call, passing the string on top of the stack (which is empty) to the interpreter. FBBI implements this using a C `system()` call, so it calls `system("")`, which leads to a segmentation fault:
```
/srv/wrappers/befunge-98: line 3:  6033 Segmentation fault      (core dumped) /opt/befunge-98/bin/fbbi .code.tio "$@" < .input.tio
```
]